Skip to content
Permalink
Browse files
fixes suggested by @Kwpolska
  • Loading branch information
ralsina committed Jun 6, 2017
1 parent de8d483 commit 43b24b2ace0c01da90a11033a9c3164a5ce1205d
Showing with 7 additions and 5 deletions.
  1. +5 −3 nikola/nikola.py
  2. +2 −2 nikola/plugins/compile/markdown/__init__.py
@@ -962,9 +962,11 @@ def __init__(self, **config):
self._GLOBAL_CONTEXT['transition'] = config.get('THEME_REVEAL_CONFIG_TRANSITION', 'cube')

# The pelican metadata format requires a markdown extension
if config.get('METADATA_FORMAT', 'nikola').lower() == 'pelican':
if 'markdown.extensions.meta' not in config.get('MARKDOWN_EXTENSIONS', []):
utils.LOGGER.warn('To use the pelican metadata format you may need to add "markdown.extensions.meta" to your MARKDOWN_EXTENSIONS setting.')
if config.get('METADATA_FORMAT').lower() == 'pelican':
if 'markdown.extensions.meta' not in config.get('MARKDOWN_EXTENSIONS', []) \
and 'markdown' in self.config['COMPILERS']:
utils.LOGGER.warn('To use the pelican metadata format you need to add '
'"markdown.extensions.meta" to your MARKDOWN_EXTENSIONS setting.')

# We use one global tzinfo object all over Nikola.
try:
@@ -161,9 +161,9 @@ def read_metadata(self, post, file_metadata_regexp=None, unslugify_titles=False,
# If the metadata starts with "---" it's actually YAML and
# we should not let markdown parse it, because it will do
# bad things like setting empty tags to "''"
if data.splitlines()[0] == '---':
if data.startswith('---\n'):
return {}
_, meta = self.converter.convert(inf.read())
_, meta = self.converter.convert(data)
# Map metadata from other platforms to names Nikola expects (Issue #2817)
map_metadata(meta, 'markdown_metadata', self.site.config)
return meta

0 comments on commit 43b24b2

Please sign in to comment.