From 2f78cd5b2efe78c687cac8927b8cf579042437d4 Mon Sep 17 00:00:00 2001 From: Chris Warrick Date: Fri, 24 Mar 2017 16:59:30 +0100 Subject: [PATCH] Fix #2699 -- ignore NEW_POST_DATE_PATH for pages Signed-off-by: Chris Warrick --- CHANGES.txt | 1 + nikola/conf.py.in | 1 + nikola/plugins/command/new_post.py | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 9a984a4bf3..0b25e53812 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -27,6 +27,7 @@ Features Bugfixes -------- +* Ignore ``NEW_POST_DATE_PATH`` when creating pages (Issue #2699) * Ensure ``post.updated`` is timezone-aware (Issue #2698) * Pass previously missing post object and language to reST compiler and language to Markdown compiler (for shortcodes) diff --git a/nikola/conf.py.in b/nikola/conf.py.in index 97242c9790..42683f6936 100644 --- a/nikola/conf.py.in +++ b/nikola/conf.py.in @@ -208,6 +208,7 @@ COMPILERS = ${COMPILERS} # Use date-based path when creating posts? # Can be enabled on a per-post basis with `nikola new_post -d`. +# The setting is ignored when creating pages (`-d` still works). # NEW_POST_DATE_PATH = False # What format to use when creating posts with date paths? diff --git a/nikola/plugins/command/new_post.py b/nikola/plugins/command/new_post.py index 286b33a4e5..d2b02fd9ea 100644 --- a/nikola/plugins/command/new_post.py +++ b/nikola/plugins/command/new_post.py @@ -242,7 +242,7 @@ def _execute(self, options, args): import_file = options['import'] wants_available = options['available-formats'] date_path_opt = options['date-path'] - date_path_auto = self.site.config['NEW_POST_DATE_PATH'] + date_path_auto = self.site.config['NEW_POST_DATE_PATH'] and content_type == 'post' date_path_format = self.site.config['NEW_POST_DATE_PATH_FORMAT'].strip('/') if wants_available: