MHmholt·May 2, 2022
Rather than JS, one can use Caddy's built-in template engine [0] to include headers/footers server-side (but way more powerful than SSI):
{{include "/includes/header.html"}}
No JS, no external build step, still static HTML files -- just pieced together by the server at request-time. Works great [1]. (Or use plain Markdown, and have Caddy's template engine render it as HTML on-the-fly. Your choice.)
[0]: https://caddyserver.com/docs/modules/http.handlers.templates
[1]: https://github.com/caddyserver/website/blob/master/src/docs/... <-- Try doing that with SSI
In The appeal of using plain HTML pages (2019)