Skip to content
Permalink
Browse files
is_mathjax -> has_math.
  • Loading branch information
felixfontein committed Apr 28, 2018
1 parent e43b64c commit 3e664ac7ba21217f30c374ea64cb7af049ceaf9d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
@@ -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 %}
@@ -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>
@@ -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
@@ -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() }}"],

0 comments on commit 3e664ac

Please sign in to comment.