From 894561734094d19a03da662377f831c6f3156c4f Mon Sep 17 00:00:00 2001 From: Fernando Serboncini Date: Thu, 4 Apr 2013 01:50:54 +0200 Subject: [PATCH] Adds a DRAFT_PATH setting for the Draft folder (defaults to "drafts") --- docs/settings.rst | 1 + pelican/generators.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/settings.rst b/docs/settings.rst index db5c0164..77d197cb 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -146,6 +146,7 @@ Setting name (default value) What doe These templates need to use ``DIRECT_TEMPLATES`` setting. `ASCIIDOC_OPTIONS` (``[]``) A list of options to pass to AsciiDoc. See the `manpage `_ +`DRAFT_PATH` (``drafts``) Path where drafts will be saved. ===================================================================== ===================================================================== .. [#] Default is the system locale. diff --git a/pelican/generators.py b/pelican/generators.py index 02412440..a5f31f97 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -347,7 +347,8 @@ class ArticlesGenerator(Generator): def generate_drafts(self, write): """Generate drafts pages.""" for article in self.drafts: - write(os.path.join('drafts', '%s.html' % article.slug), + write(os.path.join(self.settings.get('DRAFT_PATH', 'drafts'), + '%s.html' % article.slug), self.get_template(article.template), self.context, article=article, category=article.category, all_articles=self.articles)