We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 72558c4 + 24340d2 commit 2a69cf1Copy full SHA for 2a69cf1
layout/_third-party/math/index.swig
@@ -1,10 +1,20 @@
1
{% if theme.math.enable %}
2
- {% if not theme.math.per_page or (page.total or page.mathjax) %}
+ {% set is_index_has_math = false %}
3
+
4
+ {# At home, check if there has `mathjax: true` post #}
5
+ {% if is_home() %}
6
+ {% for post in page.posts %}
7
+ {% if post.mathjax and not is_index_has_math %}
8
+ {% set is_index_has_math = true %}
9
+ {% endif %}
10
+ {% endfor %}
11
12
13
+ {% if not theme.math.per_page or (is_index_has_math or page.mathjax) %}
14
{% if theme.math.engine == 'mathjax' %}
15
{% include 'mathjax.swig' %}
16
{% elif theme.math.engine == 'katex' %}
17
{% include 'katex.swig' %}
18
{% endif %}
19
20
-
0 commit comments