Skip to content

Commit

Permalink
fixes suggested by @Kwpolska
Browse files Browse the repository at this point in the history
  • Loading branch information
Roberto Alsina committed Jun 6, 2017
1 parent de8d483 commit 43b24b2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions nikola/nikola.py
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions nikola/plugins/compile/markdown/__init__.py
Expand Up @@ -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.