Rename per_page to every_page

This commit is contained in:
Mimi 2020-08-24 01:24:46 +08:00
parent 5e1b0d0e8c
commit a3dcac5f33
2 changed files with 5 additions and 5 deletions

View File

@ -495,10 +495,10 @@ baidu_push: false
# See: https://theme-next.js.org/docs/third-party-services/math-equations # See: https://theme-next.js.org/docs/third-party-services/math-equations
# Server-side plugin: https://github.com/next-theme/hexo-filter-mathjax # Server-side plugin: https://github.com/next-theme/hexo-filter-mathjax
math: math:
# Default (true) will load mathjax / katex script on demand. # Default (false) will load mathjax / katex script on demand.
# That is it only render those page which has `mathjax: true` in Front-matter. # That is it only render those page which has `mathjax: true` in Front-matter.
# If you set it to false, it will load mathjax / katex srcipt EVERY PAGE. # If you set it to true, it will load mathjax / katex srcipt EVERY PAGE.
per_page: true every_page: false
mathjax: mathjax:
enable: false enable: false

View File

@ -2,7 +2,7 @@
{%- set is_index_has_math = false %} {%- set is_index_has_math = false %}
{# At home, check if there has `mathjax: true` post #} {# At home, check if there has `mathjax: true` post #}
{%- if is_home() and theme.math.per_page %} {%- if is_home() and not theme.math.every_page %}
{%- for post in page.posts.toArray() %} {%- for post in page.posts.toArray() %}
{%- if post.mathjax and not is_index_has_math %} {%- if post.mathjax and not is_index_has_math %}
{%- set is_index_has_math = true %} {%- set is_index_has_math = true %}
@ -10,7 +10,7 @@
{%- endfor %} {%- endfor %}
{%- endif %} {%- endif %}
{%- if not theme.math.per_page or is_index_has_math or page.mathjax %} {%- if theme.math.every_page or is_index_has_math or page.mathjax %}
{%- if theme.math.mathjax.enable %} {%- if theme.math.mathjax.enable %}
{% include '_third-party/math/mathjax.njk' %} {% include '_third-party/math/mathjax.njk' %}
{% elif theme.math.katex.enable %} {% elif theme.math.katex.enable %}