jnordberg / wintersmith

A flexible static site generator
http://wintersmith.io/
MIT License
3.5k stars 335 forks source link

Workflow for draft posts #90

Closed kyvinh closed 11 years ago

kyvinh commented 11 years ago

Hi there,

When writing blog posts, I like to have some draft articles that I'm working on, but don't want published.

These draft posts should thus be seen when using wintersmith preview but not built to the static pages.

I tried using the ignore option in config.json but then I cannot preview those pages since they are completely ignored.

Is there any way to simulate this workflow? Should this functionality be a plugin?

Thanks,

Kyvinh

dashed commented 11 years ago

In my opinion, this deviates from the purpose of a static-site generator. The preview feature should be only for last-minute checks before publishing.

For my own workflow to draft posts, I use pandoc as the main parser for wintersmith (there is a plugin available in the wiki). It can generate standalone html files fairly quickly for the purpose of previewing changes (such as LaTeX). Once I'm happy, I would just copy and paste it onto wintersmith, retaining only the metadata.

To make the drafting workflow with pandoc more easier, I modified someone's gruntjs task to watch any markdown files and automatically compile them to HTML.

mimiflynn commented 11 years ago

I've been using Mou on my Mac or ReText in Linux for markdown editing since it gives me a realtime preview of the post.

jnordberg commented 11 years ago

I agree with @Dashed. I think output from the preview and build should stay the same, that said, in wintersmith 2.0 you will be able to do this by checking if environment.mode == 'preview'

I'm also toying with the idea of having the process environ exposed in some way. Then you could follow the same pattern as express e.g. using NODE_ENV=production wintersmith preview/build to control if your drafts are rendered or not.

Currently i think the best option is to use a markdown editor like @mimiflynn suggest. Mou can even preview using your own css.

kyvinh commented 11 years ago

Thanks, I did not know that it was possible to have previewing with own CSS (as noted by @jnordberg ). So that fits my requirements. Closing.

igalic commented 10 years ago

the main reason i'm looking for a way to store drafts is because i often spend a week or a month writing something. i've been using date: NaN until now. Now it's November and it shows up first in archives/index ;)

i've now started using 1999-01-01, so it'll show up last in the archive/index, rather than first, but i can still commit it/push it to have it _in git_

but i'm starting to think i should just work with branches for different articles.