Skip to content
Permalink
Browse files

Fix #2420 -- use new_post path for meta files, too

Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Aug 1, 2016
1 parent 7ace85e commit 6363199b91bd75ccd9e647740501053d9fc9b0d5
Showing with 9 additions and 4 deletions.
  1. +2 −0 CHANGES.txt
  2. +7 −4 nikola/plugins/command/new_post.py
@@ -11,6 +11,8 @@ Features
Bugfixes
--------

* Put 2-file post metadata in the same place as the text file when
specifying a path in ``new_post``, ``new_page`` (Issue #2420)
* Register dependencies in post-list shortcode (Issue #2412)
* Support post-list shortcode better (Issue #2408)
* Fix gallery links in base theme (Issue #2416)
@@ -325,14 +325,17 @@ def _execute(self, options, args):
'description': '',
'type': 'text',
}
output_path = os.path.dirname(entry[0])
meta_path = os.path.join(output_path, slug + ".meta")
pattern = os.path.basename(entry[0])
suffix = pattern[1:]

if not path:
pattern = os.path.basename(entry[0])
suffix = pattern[1:]
output_path = os.path.dirname(entry[0])

txt_path = os.path.join(output_path, slug + suffix)
meta_path = os.path.join(output_path, slug + ".meta")
else:
txt_path = os.path.join(self.site.original_cwd, path)
meta_path = os.path.splitext(txt_path)[0] + ".meta"

if (not onefile and os.path.isfile(meta_path)) or \
os.path.isfile(txt_path):

0 comments on commit 6363199

Please sign in to comment.
You can’t perform that action at this time.