Skip to content

Commit

Permalink
Added changes and improved warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein committed Apr 28, 2018
1 parent 3e664ac commit 6b297a5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGES.txt
Expand Up @@ -4,6 +4,9 @@ New in master
Features
--------

* Tags ``draft``, ``private`` and ``mathjax`` are no longer treated
special if ``USE_TAG_METADATA`` is set to ``True`` (default for
new blogs) (Issue #2761)
* Produce a better error message when a template referenced in another
template is missing (Issue #3055)
* Support captioned images and image ordering in galleries (Issue #3017)
Expand Down Expand Up @@ -127,6 +130,8 @@ Removed features
Other changes
-------------

* Rename ``is_mathjax`` to ``has_math``. Themes using ``is_mathjax`` must
be updated; it is recommended that they are changed to use ``math_helper.tmpl``.
* Rename ``crumbs.tmpl`` to ``ui_helper.tmpl`` and the breadcrumbs
``bar`` function to ``breadcrumbs``

Expand Down
9 changes: 9 additions & 0 deletions nikola/post.py
Expand Up @@ -270,12 +270,21 @@ def __init__(
'Valid values are "published", "private" and "draft".').format(self.source_path, status))

if self.config['WARN_ABOUT_TAG_METADATA']:
show_warning = False
if 'draft' in [_.lower() for _ in self._tags[lang]]:
LOGGER.warn('The post "{0}" uses the "draft" tag.'.format(self.source_path))
show_warning = True
if 'private' in self._tags[lang]:
LOGGER.warn('The post "{0}" uses the "private" tag.'.format(self.source_path))
show_warning = True
if 'mathjax' in self._tags[lang]:
LOGGER.warn('The post "{0}" uses the "mathjax" tag.'.format(self.source_path))
show_warning = True
if show_warning:
LOGGER.warn('It is suggested that you convert special tags to metadata and set ' +
'USE_TAG_METADATA to False. You can use the XXX command plugin for ' +
'conversion. Change the WARN_ABOUT_TAG_METADATA configuration to ' +
'disable this warning.')
if self.config['USE_TAG_METADATA']:
if 'draft' in [_.lower() for _ in self._tags[lang]]:
is_draft = True
Expand Down

0 comments on commit 6b297a5

Please sign in to comment.