You can use entities to create static sites in advance, or by including support in the browser. sgmljs can do both, and simply using shared headers/footers for static site generation from markdown and other SGML partials is explained in [1].
[1]: https://sgmljs.sgml.net/docs/producing-html-tutorial/produci...