Skip to content

Commit

Permalink
Fix #2699 -- ignore NEW_POST_DATE_PATH for pages
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Mar 24, 2017
1 parent 96c6d1d commit 2f78cd5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.txt
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions nikola/conf.py.in
Expand Up @@ -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?
Expand Down
2 changes: 1 addition & 1 deletion nikola/plugins/command/new_post.py
Expand Up @@ -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:
Expand Down

0 comments on commit 2f78cd5

Please sign in to comment.