aboutsummaryrefslogtreecommitdiffstats
path: root/nikola/plugins/compile_html.py
diff options
context:
space:
mode:
Diffstat (limited to 'nikola/plugins/compile_html.py')
-rw-r--r--nikola/plugins/compile_html.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/nikola/plugins/compile_html.py b/nikola/plugins/compile_html.py
index 6c1c381..7551b33 100644
--- a/nikola/plugins/compile_html.py
+++ b/nikola/plugins/compile_html.py
@@ -43,19 +43,17 @@ class CompileHtml(PageCompiler):
pass
shutil.copyfile(source, dest)
- def create_post(self, path, onefile=False, title="", slug="",
- date="", tags=""):
+ def create_post(self, path, onefile=False, **kw):
+ metadata = {}
+ metadata.update(self.default_metadata)
+ metadata.update(kw)
d_name = os.path.dirname(path)
if not os.path.isdir(d_name):
os.makedirs(os.path.dirname(path))
with codecs.open(path, "wb+", "utf8") as fd:
if onefile:
fd.write('<!-- \n')
- fd.write('.. title: {0}\n'.format(title))
- fd.write('.. slug: {0}\n'.format(slug))
- fd.write('.. date: {0}\n'.format(date))
- fd.write('.. tags: {0}\n'.format(tags))
- fd.write('.. link: \n')
- fd.write('.. description: \n')
+ for k, v in metadata.keys():
+ fd.write('.. {0}: {1}\n'.format(k, v))
fd.write('-->\n\n')
fd.write("\n<p>Write your post here.</p>")