diff --git a/_config.yml b/_config.yml index 3e94dac..aeb1731 100644 --- a/_config.yml +++ b/_config.yml @@ -495,10 +495,10 @@ baidu_push: false # See: https://theme-next.js.org/docs/third-party-services/math-equations # Server-side plugin: https://github.com/next-theme/hexo-filter-mathjax 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. - # If you set it to false, it will load mathjax / katex srcipt EVERY PAGE. - per_page: true + # If you set it to true, it will load mathjax / katex srcipt EVERY PAGE. + every_page: false mathjax: enable: false diff --git a/layout/_third-party/math/index.njk b/layout/_third-party/math/index.njk index e93f235..14a72e1 100644 --- a/layout/_third-party/math/index.njk +++ b/layout/_third-party/math/index.njk @@ -2,7 +2,7 @@ {%- set is_index_has_math = false %} {# 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() %} {%- if post.mathjax and not is_index_has_math %} {%- set is_index_has_math = true %} @@ -10,7 +10,7 @@ {%- endfor %} {%- 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 %} {% include '_third-party/math/mathjax.njk' %} {% elif theme.math.katex.enable %}