4 ms·
Use a webserver with server side includes (SSI) like nginx or apache and you can <!--# include file="/header.html" --> in the other HTML files themselves and it
by superkuh 2y ago
Use a webserver with server side includes (SSI) like nginx or apache and you can <!--# include file="/header.html" --> in the other HTML files themselves and it's all completely transparent. No need to 'build' or anything. And no complex software stack to mantain or worries about attack surfaces like with dynamic languages like php. Just the bare minimum power to do templating that hasn't changed or had issues in 20 years.
- numlocked 2y agoWell, except for the webserver with nginx or apache, correctly configured with SSIs enabled. It's not terrible -- but not 'obviously' less complex than using e.g. 11ty (a static site generator) + uploading to an s3 bucket or FTP server. Just trading off complexity in one place for complexity in another. A sibling (top-level) comment suggest a standard HTML templating (or SSI) language that many static hosts would support. I like that idea quite a bit conceptually, though of course much easier said than done.