aboutsummaryrefslogtreecommitdiffstats
path: root/nikola/plugins/compile/markdown/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'nikola/plugins/compile/markdown/__init__.py')
-rw-r--r--nikola/plugins/compile/markdown/__init__.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/nikola/plugins/compile/markdown/__init__.py b/nikola/plugins/compile/markdown/__init__.py
index b41c6b5..1376b11 100644
--- a/nikola/plugins/compile/markdown/__init__.py
+++ b/nikola/plugins/compile/markdown/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -50,6 +50,12 @@ except ImportError:
gist_extension = None
podcast_extension = None
+
+try:
+ from collections import OrderedDict
+except ImportError:
+ OrderedDict = None # NOQA
+
from nikola.plugin_categories import PageCompiler
from nikola.utils import makedirs, req_missing
@@ -58,6 +64,7 @@ class CompileMarkdown(PageCompiler):
"""Compile markdown into HTML."""
name = "markdown"
+ demote_headers = True
extensions = [gist_extension, nikola_extension, podcast_extension]
site = None
@@ -75,7 +82,10 @@ class CompileMarkdown(PageCompiler):
out_file.write(output)
def create_post(self, path, onefile=False, **kw):
- metadata = {}
+ if OrderedDict is not None:
+ metadata = OrderedDict()
+ else:
+ metadata = {}
metadata.update(self.default_metadata)
metadata.update(kw)
makedirs(os.path.dirname(path))