Skip to content

Fix katex CSS includes#53

Merged
DanilaFe merged 2 commits intochapel-lang:mainfrom
DanilaFe:fix-katex-css-includes
Feb 2, 2026
Merged

Fix katex CSS includes#53
DanilaFe merged 2 commits intochapel-lang:mainfrom
DanilaFe:fix-katex-css-includes

Conversation

@DanilaFe
Copy link
Contributor

@DanilaFe DanilaFe commented Jan 29, 2026

Discussed in more detail in the Hugo issue I opened: gohugoio/hugo#14455 (comment)

Essentially, we were seeing that Hugo would tag list pages as having mathematics, even though it was the pages that were being included in the list that actually had math. I believed it was doing so erroneously, and indeed it was; due to gohugoio/hugo#9692, the page context was not being given by our details and summary templates to markdown rendering, causing mathematics render hooks to receive the global page as their context. This would get tagged with the hasMath tag.

This PR fixes that, which causes the hasMath tag to be unset for list pages...

Except, as pointed out by Joe in the Hugo thread, the un-buggy behavior is undesirable, because if the summarized page has math in its summary, this will result in the list page not having the KaTeX CSS even though it needs it. Thus, in this case, the behavior we saw was actually helpful. This PR thus also explicitly propagates hasMath to the page that calls .Summary. This seems to match the previously accidental behavior -- though, I suspect, this is not sufficient, and further investigation is needed, because right now, even pages on the front page have math, but only the 3rd pagination page onwards is tagged with KaTeX CSS.

In any case, for the time being this is not an issue since our page summaries do not have math in then.

Reviewed by @bradcray -- thanks!

Signed-off-by: Danila Fedorin <daniel.fedorin@hpe.com>
Signed-off-by: Danila Fedorin <daniel.fedorin@hpe.com>
Copy link
Member

@bradcray bradcray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for walking me through this interactively, Daniel!

@DanilaFe DanilaFe merged commit 38e12e2 into chapel-lang:main Feb 2, 2026
1 check passed
bradcray added a commit to chapel-lang/chapel-www that referenced this pull request Feb 3, 2026
---
Signed-off-by: Brad Chamberlain <bradcray@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants