diff options
| author | 2014-03-09 03:14:40 +0100 | |
|---|---|---|
| committer | 2014-03-09 03:14:40 +0100 | |
| commit | fa50632a9d87c3989566fed3e49c160a132e0d14 (patch) | |
| tree | 81f58cc0dcfbb34710856b59c034bc47c53d91dc /nikola/plugins/compile/php.py | |
| parent | 2828399ba5cbb14502b023d4de1ba02f13dd5055 (diff) | |
Imported Upstream version 6.4.0upstream/6.4.0
Diffstat (limited to 'nikola/plugins/compile/php.py')
| -rw-r--r-- | nikola/plugins/compile/php.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/nikola/plugins/compile/php.py b/nikola/plugins/compile/php.py index 14b80e8..0a652a6 100644 --- a/nikola/plugins/compile/php.py +++ b/nikola/plugins/compile/php.py @@ -38,7 +38,7 @@ from nikola.utils import makedirs try: from collections import OrderedDict except ImportError: - OrderedDict = None # NOQA + OrderedDict = dict # NOQA class CompilePhp(PageCompiler): @@ -50,11 +50,8 @@ class CompilePhp(PageCompiler): makedirs(os.path.dirname(dest)) shutil.copyfile(source, dest) - def create_post(self, path, onefile=False, **kw): - if OrderedDict is not None: - metadata = OrderedDict() - else: - metadata = {} + def create_post(self, path, onefile=False, is_page=False, **kw): + metadata = OrderedDict() metadata.update(self.default_metadata) metadata.update(kw) os.makedirs(os.path.dirname(path)) @@ -64,7 +61,7 @@ class CompilePhp(PageCompiler): for k, v in metadata.items(): fd.write('.. {0}: {1}\n'.format(k, v)) fd.write('-->\n\n') - fd.write("\n<p>Write your post here.</p>") + fd.write("\n<p>Write your {0} here.</p>".format('page' if is_page else 'post')) def extension(self): return ".php" |
