Skip to content
Permalink
Browse files

Guess format from path on new_post (Issue #2798)

  • Loading branch information
ralsina committed May 25, 2017
1 parent 274cf88 commit 5ab12ac9ea2f5773d98df53e4ff68a7f0400e1fe
Showing with 9 additions and 0 deletions.
  1. +1 −0 CHANGES.txt
  2. +8 −0 nikola/plugins/command/new_post.py
@@ -4,6 +4,7 @@ New in master
Features
--------

* Guess file format from file name on new_post (Issue #2798)
* Use BaguetteBox as lightbox in base theme (Issue #2777)
* New ``deduplicate_ids``, for preventing duplication of HTML id
attributes (Issue #2570)
@@ -273,6 +273,14 @@ def _execute(self, options, args):
if extension in extensions:
content_format = compiler

elif not content_format and import_file:
# content_format not specified. If import_file was given, use
# it to guess (Issue #2798)
extension = os.path.splitext(import_file)[-1]
for compiler, extensions in self.site.config['COMPILERS'].items():
if extension in extensions:
content_format = compiler

elif not content_format: # Issue #400
content_format = get_default_compiler(
is_post,

0 comments on commit 5ab12ac

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