Skip to content
Permalink
Browse files
fix #2205
  • Loading branch information
ralsina committed Jan 4, 2016
1 parent d362b18 commit c84e558c1cef335f55ce9fbe5643cbc4c279989e
Showing with 8 additions and 4 deletions.
  1. +2 −0 CHANGES.txt
  2. +6 −4 nikola/post.py
@@ -14,6 +14,8 @@ Features
Bugfixes
--------

* Decide is_mathjax based on current language tags (Issue #2205)

New in v7.7.4
=============

@@ -109,7 +109,6 @@ def __init__(
self.base_url = self.config['BASE_URL']
self.is_draft = False
self.is_private = False
self.is_mathjax = False
self.strip_indexes = self.config['STRIP_INDEXES']
self.index_file = self.config['INDEX_FILE']
self.pretty_urls = self.config['PRETTY_URLS']
@@ -223,9 +222,6 @@ def __init__(
self.use_in_feeds = use_in_feeds and not is_draft and not is_private \
and not self.publish_later

# If mathjax is a tag, or it's a ipynb post, then enable mathjax rendering support
self.is_mathjax = ('mathjax' in self.tags) or (self.compiler.name == 'ipynb')

# Register potential extra dependencies
self.compiler.register_extra_dependencies(self)

@@ -258,6 +254,12 @@ def _has_pretty_url(self, lang):
else:
return False

@property
def is_mathjax(self):
"""True if this post has the mathjax tag in the current language or is a python notebook."""
lang = nikola.utils.LocaleBorg().current_lang
return ('mathjax' in self.tags_for_language(lang)) or (self.compiler.name == 'ipynb')

@property
def alltags(self):
"""Return ALL the tags for this post."""

0 comments on commit c84e558

Please sign in to comment.