index.swig 703 B

1234567891011121314151617181920
  1. {%- if theme.math.mathjax.enable or theme.math.katex.enable %}
  2. {%- set is_index_has_math = false %}
  3. {# At home, check if there has `mathjax: true` post #}
  4. {%- if is_home() and theme.math.per_page %}
  5. {%- for post in page.posts.toArray() %}
  6. {%- if post.mathjax and not is_index_has_math %}
  7. {%- set is_index_has_math = true %}
  8. {%- endif %}
  9. {%- endfor %}
  10. {%- endif %}
  11. {%- if not theme.math.per_page or is_index_has_math or page.mathjax %}
  12. {%- if theme.math.mathjax.enable %}
  13. {% include '_third-party/math/mathjax.swig' %}
  14. {% elif theme.math.katex.enable %}
  15. {% include '_third-party/math/katex.swig' %}
  16. {%- endif %}
  17. {%- endif %}
  18. {%- endif %}