diff options
| author | 2013-05-30 17:41:06 -0300 | |
|---|---|---|
| committer | 2013-05-30 17:41:06 -0300 | |
| commit | 0c4dfdec5b55b6064dccc38bbfb0a7c0699c895a (patch) | |
| tree | a6707225ccc559f7edf50ddd3fdc7fc85145c921 /nikola/plugins/compile_html.py | |
| parent | 8b14a1e5b2ca574fdd4fd2377567ec98a110d4b6 (diff) | |
Imported Upstream version 5.4.4
Diffstat (limited to 'nikola/plugins/compile_html.py')
| -rw-r--r-- | nikola/plugins/compile_html.py | 14 |
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>") |
