mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-18 18:33:42 +00:00
21 lines
701 B
Plaintext
21 lines
701 B
Plaintext
{%- if theme.math.mathjax.enable or theme.math.katex.enable %}
|
|
{%- set is_index_has_math = false %}
|
|
|
|
{# At home, check if there has `mathjax: true` post #}
|
|
{%- if is_home() and theme.math.per_page %}
|
|
{%- for post in page.posts.toArray() %}
|
|
{%- if post.mathjax and not is_index_has_math %}
|
|
{%- set is_index_has_math = true %}
|
|
{%- endif %}
|
|
{%- endfor %}
|
|
{%- endif %}
|
|
|
|
{%- if not theme.math.per_page or is_index_has_math or page.mathjax %}
|
|
{%- if theme.math.mathjax.enable %}
|
|
{% include '_third-party/math/mathjax.njk' %}
|
|
{% elif theme.math.katex.enable %}
|
|
{% include '_third-party/math/katex.njk' %}
|
|
{%- endif %}
|
|
{%- endif %}
|
|
{%- endif %}
|