3 ms·
> I am looking for something where I can keep my header and footer separate and then include them in every other page. Are you married to markdown or is HTML m
by lelanthran 3y ago
> I am looking for something where I can keep my header and footer separate and then include them in every other page.
Are you married to markdown or is HTML markup sufficient[1]? Because just using a single 5-line web-component is sufficient for a shared header/footer on each page.
I have a tiny web-component that does this (the shortest I saw in the wild is a 5-line one). Lets you do things like this:
<html>
<body>
<zjs-include remote-src="./header.html"> </zjs-include>
... content ...
<zjs-include remote-src="./footer.html"> </zjs-include>
</body>
</html>
[1] Although markdown does let you include verbatim HTML, so you can use web-components directly within markdown too. A 2-line bash script to call pandoc to turn markdown into HTML is sufficient.