Using Templates with Caddy and Hugo

Hugo is a static site generator. However sometimes we want to serve dynamic contents. We can embed javascript to achieve what we want, but why not use templates when they’re more convenient? Caddy Template Engine Caddy comes with a powerful template engine that is based on golang standard library. Some of the sites (including Caddy’s official website) are built this way. The list of template functions/actions can be viewed here. In addition, caddy also support all Sprig functions....

published on October 10, 2023 · 3 min · 472 words

Adding Mermaid Support to PaperMod Theme

Mermaid is a javascript library that can render text definitions as diagrams. It’s not supported by PaperMod. There are two major problems that I encountered when adding mermaid support. Mermaid Diagrams not Showing I tried the method described in this comment. It only worked in my local development environment. And when I put mermaid related snippets in extend_footer.html like the author suggested, it won’t even work. Cause The head and the footer of the theme is handled by baseof....

published on April 22, 2023 · 3 min · 538 words