You have a couple of options. A simple yet hackish one would be to use filename templating and set the filename to something like draft.html
and ignore it in some htaccess file.
in metadata: filename: "{{ (page.date>Date.now()) ? 'draft' : 'index' }}.html"
Another option would be to create a generator that populates a tree based on your conditions, check https://github.com/jnordberg/wintersmith/blob/master/examples/blog/plugins/paginator.coffee for a example.
Or you can subclass the MarkdownPage plugin and re-register it with your own custom additions, perhaps adding a draft
property and a check in getView
to send it to none
if draft is true.
class DraftyPage extends MarkdownPage
isDraft: -> @date > Date.now()
getView: ->
return 'none' if @isDraft()
return super()
env.registerContentPlugin 'pages', '**/*.*(markdown|mkd|md)', DraftyPage
See: https://github.com/jnordberg/wintersmith/blob/master/src/plugins/page.coffee https://github.com/jnordberg/wintersmith/blob/master/src/plugins/markdown.coffee