Re:Rewriting my website in plain HTML and CSS
by recursive on Tuesday January 14, 2025 @07:13PM
(#42705757)
In the 90s, we used Server Side Includes (SSI) for this. Probably still works.
[ Parent
| on HN ]
Re:Rewriting my website in plain HTML and CSS
by skyfaller on Tuesday January 14, 2025 @07:26PM
(#42705855)
One modern approach would be Caddy Server's templates, using Golang templating:
https://caddyserver.com/docs/modules/http.handlers.templates
The "include" function should do the job:
{{include "path/to/file.html"}}
Re:Rewriting my website in plain HTML and CSS
by ZYbCRq22HbJ2y7 on Tuesday January 14, 2025 @07:34PM
(#42705917)
httpd, nginx, a number of other servers support SSI
https://nginx.org/en/docs/http/ngx_http_ssi_module.html
Caddy chose not to, I guess?
https://caddy.community/t/caddy-update-on-ssi-server-side-in...
Re:Rewriting my website in plain HTML and CSS
by alwillis on Wednesday January 15, 2025 @01:35AM
(#42708019)
You generally can’t use SSI on many popular platforms for static websites like Netlify, etc.
Re:Rewriting my website in plain HTML and CSS
by someothherguyy on Wednesday January 15, 2025 @02:53AM
(#42708465)
However, you could generate the static HTML easily and then publish it on those platforms, which is what many people do today (probably not often using SSI).