Skip to content

Commit

Permalink
fix #2205
Browse files Browse the repository at this point in the history
  • Loading branch information
ralsina committed Jan 4, 2016
1 parent d362b18 commit c84e558
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGES.txt
Expand Up @@ -14,6 +14,8 @@ Features
Bugfixes
--------

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

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

Expand Down
10 changes: 6 additions & 4 deletions nikola/post.py
Expand Up @@ -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']
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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."""
Expand Down

0 comments on commit c84e558

Please sign in to comment.