-
Notifications
You must be signed in to change notification settings - Fork 2k
Description
I agree and want to create new issue
- Yes, I was on Hexo Docs page, especially on Templates, Variables, Helpers and Troubleshooting.
- Yes, I was on NexT Documentation Site.
- And yes, I already searched for current issues and this is not help to me.
Expected behavior
Math script won't be loaded with no math in tags, achives pages etc.
Actual behavior
Math sript loaded in tags, achives pages etc. even if there is no math in homepage.
Steps to reproduce the behavior
- Turn on
enableofmath hexo clean && hexo g -d
- Link to demo site with this issue: https://wafer.li/
- Link(s) to source code or any usefull link(s):
{% if not theme.math.per_page or (page.total or page.mathjax) %}
This line, for now, per_page default to true, then not theme.math.per_page will befalse.
And if we are at homepage now, page.total will be true, therefore even if page.mathjax is false, the(page.total or page.mathjax) still be true.
Finally, after those determinations, the if not theme.math.per_page or (page.total or page.mathjax) will return true and load the math script.
Since the tags and achives pages has the post.total property, and it will load the math script in tags and achives pages.
Node.js and NPM Information
Package dependencies Information
Hexo Information
Hexo version
Hexo Configuration
NexT Information
NexT Version:
[x] Latest Master branch.
[] Latest Release version.
[] Old version -
NexT Scheme:
[x] All schemes
[] Muse
[] Mist
[] Pisces
[] Gemini
NexT Configuration:
# Math Equations Render Support
math:
enable: true
# Default(true) will load mathjax/katex script on demand
# That is it only render those page who has 'mathjax: true' in Front Matter.
# If you set it to false, it will load mathjax/katex srcipt EVERY PAGE.
per_page: true
#engine: mathjax
engine: katexOther Information
And there is the screenshot:
I have no math in my homepage, but it still load the Katex CSS.
And in achives too:

