Skip to content

Commit

Permalink
is_mathjax -> has_math.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein committed Apr 28, 2018
1 parent e43b64c commit 3e664ac
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions nikola/data/themes/base-jinja/templates/math_helper.tmpl
Expand Up @@ -45,25 +45,25 @@
{% endmacro %}

{% macro math_scripts_ifpost(post) %}
{% if post.is_mathjax %}
{% if post.has_math %}
{{ math_scripts() }}
{% endif %}
{% endmacro %}

{% macro math_scripts_ifposts(posts) %}
{% if posts|selectattr("is_mathjax")|list %}
{% if posts|selectattr("has_math")|list %}
{{ math_scripts() }}
{% endif %}
{% endmacro %}

{% macro math_styles_ifpost(post) %}
{% if post.is_mathjax %}
{% if post.has_math %}
{{ math_styles() }}
{% endif %}
{% endmacro %}

{% macro math_styles_ifposts(posts) %}
{% if posts|selectattr("is_mathjax")|list %}
{% if posts|selectattr("has_math")|list %}
{{ math_styles() }}
{% endif %}
{% endmacro %}
8 changes: 4 additions & 4 deletions nikola/data/themes/base/templates/math_helper.tmpl
Expand Up @@ -45,25 +45,25 @@
</%def>

<%def name="math_scripts_ifpost(post)">
%if post.is_mathjax:
%if post.has_math:
${math_scripts()}
%endif
</%def>

<%def name="math_scripts_ifposts(posts)">
%if any(post.is_mathjax for post in posts):
%if any(post.has_math for post in posts):
${math_scripts()}
%endif
</%def>

<%def name="math_styles_ifpost(post)">
%if post.is_mathjax:
%if post.has_math:
${math_styles()}
%endif
</%def>

<%def name="math_styles_ifposts(posts)">
%if any(post.is_mathjax for post in posts):
%if any(post.has_math for post in posts):
${math_styles()}
%endif
</%def>
2 changes: 1 addition & 1 deletion nikola/post.py
Expand Up @@ -340,7 +340,7 @@ def _has_pretty_url(self, lang):
return self.has_pretty_url(lang)

@property
def is_mathjax(self):
def has_math(self):
"""Return True if this post has has_math set to True or is a python notebook.
Alternatively, it will return True if it has set the mathjax tag in the
Expand Down
2 changes: 1 addition & 1 deletion scripts/jinjify.py
Expand Up @@ -14,7 +14,7 @@
import jinja2

dumb_replacements = [
["{% if any(post.is_mathjax for post in posts) %}", '{% if posts|selectattr("is_mathjax")|list %}'],
["{% if any(post.has_math for post in posts) %}", '{% if posts|selectattr("has_math")|list %}'],
["json.dumps(title)", "title|tojson"],
["{{ parent.extra_head() }}", "{{ super() }}"],
["{{ parent.content() }}", "{{ super() }}"],
Expand Down

0 comments on commit 3e664ac

Please sign in to comment.