Fonts from Theme's Static Folder not loading (Confusion with minify?)

My repo is here GitHub - pocofrosty/pocofrosty.github.io: Personal Website for Darren Zheng. I’m encountering some confusing behavior for me to do with the minifying CSS (although this is implemented directly by the theme’s author and I couldn’t seem to find anyone else with issues on the inactive Github Repo Code search results).

When I view the “Spring 2023” post, I can see the math render properly as below:


It seems to pull the fonts directly from .../css/fonts/..., which is published to public from the copy of the fonts stored in my own static directory. However, this seems redundant to me as Poison seems to store the fonts in the theme’s static folder. Additionally, the font.css file gets pushed to the public folder via pipes through:

{{ $css_bundle := slice
(resources.Get “css/poole.css”)
(resources.Get “css/codeblock.css”)
(resources.Get “css/hyde.css”)
(resources.Get “css/poison.css”)
(resources.Get “css/fonts.css”)
(resources.Get “css/lib/katex.css”)
(resources.Get “css/tabs.css”)
(resources.Get “css/custom.css”)
| resources.Concat “css/bundle.css” | minify | fingerprint }}

I can't seem to figure out why deleting my local folder of the katex fonts breaks the site. It isnt clear to me why the fonts from the theme's static folder aren't appearing in public folder, or why its looking for the fonts in `css/fonts/...` in the first place. My suspicion is I'm misunderstanding how hugo's pipeline works, but I don't believe I override any default theme behavior with respect to this. Would appreciate any comments to help clear my confusion.

Sorry for the hastily written post, please let me know if the above description of my issue is unclear.

EDIT: After a bit more digging, I’m convinced it’s a CSS error. For some reason the requests are to:

I have no clue why it’s pre-fixing /ccs/ as my font-family is imported in CSS

Will need to continue digging through the theme itself to figure out the issue.

The font URL is relative to the location of the CSS file.

2 Likes

Thanks for the clarity. It was so simple after all, and I now see my bundled CSS was in fact under that folder.

I’ve realized the original theme seems to have this error, and I was just under the assumption that the theme itself wouldn’t be the source of the issue, as I didn’t see anyone else having an issue with it in my searching.

maybe because no one notices or you’re the only one using Katex with Poison or just the one with the catching eye :wink:

If a font is missing your browser will just choose some other font.

the theme has fonts in

  • static/fonts
  • static/katex/fonts ← this one imho is wrong according to the css provided by the theme

you added

  • static/css/fonts ← which adds the missing KaTeX ones

if you remove ALL the font folders and build → the site incl the Math is displaying – at least – readable

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.