getnikola / nikola

A static website and blog generator
https://getnikola.com/
MIT License
2.6k stars 444 forks source link

MathJax loads on site index if a post with "has_math: true" is shown, without checking for LaTeX visibility #3669

Closed 000yesnt closed 1 year ago

000yesnt commented 1 year ago

Environment

Python Version: Python 3.11.1 (tags/v3.11.1:a7a450f, Dec 6 2022, 19:58:39) [MSC v.1934 64 bit (AMD64)] on win32

Nikola Version: 8.2.3

Operating System: Windows 10 10.0.19045.2604

Description:

When a post with the has_math: true metadata field is shown on the site index, MathJax is loaded regardless of whether there's any visible LaTeX, wasting bandwidth.

For example, with index teasers enabled and END_TEASER placed before the math directive, MathJax loads. This also seems to happen when a post has no content, but has_math is on.

No other settings were changed; this is a fully stock Nikola site.

Screenshots: Case: No posts with has_math enabled

Case: one post with has_math enabled

Case: contentless post with has_math enabled

Kwpolska commented 1 year ago

Thanks for reporting this, but we can’t fix this in any good way.