Hugo + Mmark + KaTeX rendering at build

What can be done to render math expressions during the build step instead of inside the browser? I agree KaTeX is fast and Mmark makes it super easy for math stuff to avoid Markdown processing but why would you waste computing ressources on compiling the same strings again and again plus it makes pages flicker. A dirty hack would be to postprocess the generated HTML files but how would that properly integrate with the hugo and hugo server commands. How can we guarantee that the generated code would be compatible with the CDN served fonts and CSS?

1 Like

Hello @aureooms,

at the time of writing this post Hugo does not support pre- or post-precessing steps for the site generation. While using Katex is the simplest way to get math expressions rendered you could alternatively an external script that does the rendering.