Pre-render LaTeX in hugo at build #13
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
To save on page size, pre-render LaTeX.
Today the whold library (~1mb) is served on every page...
I tried and failed on the old repo. Retry !
Useful resources :
https://gohugo.io/render-hooks/passthrough/
https://www.andyleemitchell.com/posts/latex-in-hugo/
Previous notes :
MathJax js LaTeX library is 1mb. that's too much (goal : 1mb max on every page)
KaTex js LaTeX library is only 0.26 mb, but that is still uncessary. Also it has trouble rendering inline LaTeX like
a + b = cwhen there also is $ in the text.It is possible to use render hooks to render latex server side, thus ligntening download size
https://gohugo.io/functions/transform/tomath/