Skip to content
Permalink
Browse files
merge master
  • Loading branch information
ralsina committed Jan 4, 2016
2 parents d31e8e6 + 8e92f13 commit 21dfc0fd6cdd920889d65faaa0edb586a47f1ac9
Showing with 15 additions and 5 deletions.
  1. +1 −0 CHANGES.txt
  2. +3 −1 nikola/nikola.py
  3. +11 −4 nikola/post.py
@@ -15,6 +15,7 @@ Bugfixes
--------

* Preserve EXIF data when resizing images (Issue #2204)
* Decide is_mathjax based on current language tags (Issue #2205)

New in v7.7.4
=============
@@ -1757,7 +1757,9 @@ def scan_posts(self, really=False, ignore_quit=False, quiet=False):
# Sort everything.

for thing in self.timeline, self.posts, self.all_posts, self.pages:
thing.sort(key=lambda p: (p.date, p.source_path))
thing.sort(key=lambda p:
(int(p.meta('priority')) if p.meta('priority') else 0,
p.date, p.source_path))
thing.reverse()
self._sort_category_hierarchy()

@@ -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,17 @@ 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."""
if self.compiler.name == 'ipynb':
return True
lang = nikola.utils.LocaleBorg().current_lang
if self.is_translation_available(lang):
return 'mathjax' in self.tags_for_language(lang)
# If it has math in ANY other language, enable it. Better inefficient than broken.
return 'mathjax' in self.alltags

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

0 comments on commit 21dfc0f

Please sign in to comment.