4 ms·
> I am looking for something where I can keep my header and footer separate and then include them in every other page. As others have said, this is a perfect f
by e12e 3y ago
> I am looking for something where I can keep my header and footer separate and then include them in every other page.
As others have said, this is a perfect fit for SSI. You could also deploy a simple php page (just using php as a template engine with server side/host support).
I've experimented with m4 for something similar in the past.
I would probably recommend going with Hugo, though:
https://discourse.gohugo.io/t/solved-using-html-for-content-pages-instead-of-markdown/3374 https://discourse.gohugo.io/t/solved-using-html-for-content-...
https://gohugo.io/getting-started/quick-start/ https://gohugo.io/getting-started/quick-start/
An article from 1997 on using m4 and make - would strongly recommend just using php cli these days...: https://tldp.org/LDP/LG/issue22/using_m4.html https://tldp.org/LDP/LG/issue22/using_m4.html
For rolling your own in php, see:
https://rosswintle.uk/2021/12/hang-on-php-is-a-static-site-generator/ https://rosswintle.uk/2021/12/hang-on-php-is-a-static-site-g...
https://www.dah5.com/staticphp/ https://www.dah5.com/staticphp/