Giter Club home page Giter Club logo

Comments (8)

imfing avatar imfing commented on July 21, 2024

@jonasreiher the font files are embedded here: https://github.com/imfing/hextra/tree/main/assets/lib/katex/fonts

I'm not sure why GitLab normalize those filenames to all lower-cases. This issue doesn't happen on GitHub Pages though: https://imfing.github.io/hextra/docs/guide/latex/

from hextra.

jonasreiher avatar jonasreiher commented on July 21, 2024

Ok, I'm now relatively sure that this is not a GitLab issue.

In the folder you referenced (/assets/lib/katex/fonts), the font files all have their original mixed-case names.
On your deployed site, they still keep these mixed-case names. E.g. imfing.github.io/.../KaTeX_AMS-Regular.woff2 exists while imfing.github.io/.../katex_ams-regular.woff2 does not exist.
So far, so good.

Next, I'm locally running hugo server in my site's repository. Here, https://localhost:1313/lib/katex/fonts/KaTeX_AMS-Regular.woff2 and https://localhost:1313/lib/katex/fonts/katex_ams-regular.woff2 both URLs exist and a mixed-case or lower-case file, respectively, lands in my downloads.
This is already interesting.

Finally, I'm locally running just the build command hugo in my repository. Now the public folder contains only the lower-case font files, e.g. public/lib/katex/fonts/katex_ams-regular.woff2.
Since this is what arrives on GitLab pages, it's no wonder that the mixed-case URLs lead to a 404.

I haven't yet found out what is causing this renaming and why it's not happening on your site. Maybe the theme inclusion as a Hugo module does something unexpected. I'm using the Hugo and theme versions mentioned in the issue description above.

from hextra.

jonasreiher avatar jonasreiher commented on July 21, 2024

This may be related to the setting disablePathToLower which is false by default. However, simple setting this to true in my hugo.yaml doesn't seem to be sufficient.

Also, as of this comment, hugo server is case insensitive which would explain why I don't have issues there.

from hextra.

Hifive55555 avatar Hifive55555 commented on July 21, 2024

I have the same problem. I'm not deploy the site with GitLab or GitHub Pages. Instead, I use hugo -D -w to deploy it on my own server and when it comes to render KaTex signs, it fails to load resource with a status of 404. I'm looking for a solution.

from hextra.

imfing avatar imfing commented on July 21, 2024

@Hifive55555 Hi, did you check the browser devtool network tab? I wonder if it's caused by requesting the lower-case font files?

from hextra.

imfing avatar imfing commented on July 21, 2024

@jonasreiher @Hifive55555 I believe it's a Hugo issue, in the newest 0.123.x I was able to reproduce it

v0.122.0

$ hugo
Start building sites … 
hugo v0.122.0-b9a03bd59d5f71a529acb3e33f995e0ef332b3aa+extended linux/amd64 BuildDate=2024-01-26T15:54:24Z VendorInfo=gohugoio


                   | EN  
-------------------+-----
  Pages            | 14  
  Paginator pages  |  0  
  Non-page files   |  0  
  Static files     | 11  
  Processed images |  0  
  Aliases          |  0  
  Sitemaps         |  1  
  Cleaned          |  0  

Total in 134 ms
$ ls public/lib/katex/fonts/
KaTeX_AMS-Regular.ttf            KaTeX_Fraktur-Regular.ttf    KaTeX_Main-Regular.ttf

v0.123.6

$ hugo
Start building sites … 
hugo v0.123.6-92684f9a26838a46d1a81e3c250fef5207bcb735+extended linux/amd64 BuildDate=2024-02-28T18:29:40Z VendorInfo=brew


                   | EN  
-------------------+-----
  Pages            | 15  
  Paginator pages  |  0  
  Non-page files   |  0  
  Static files     | 11  
  Processed images |  0  
  Aliases          |  0  
  Cleaned          |  0  

Total in 107 ms
$ ls public/lib/katex/fonts/
katex_ams-regular.ttf            katex_fraktur-regular.ttf    katex_main-regular.ttf

from hextra.

imfing avatar imfing commented on July 21, 2024

updates: I believe it's fixed by gohugoio/hugo@7023cf0

Please wait for Hugo to cut a patch release

Related issue: gohugoio/hugo#12182

from hextra.

jonasreiher avatar jonasreiher commented on July 21, 2024

Indeed! Thank you for finding this! In the meantime, I'll go back to Hugo v.0.122

from hextra.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.