It’s not an only html solution, but I’m fond of using nginx server side v includes, which with a little setup let’s you do things
<--# set var="browser-title" value="Colophon" -->
<--# set var="page-title" value="oink" -->
<--# include file="/stubs/header.shtml" -->
You can do simple things like set variables and import reusable html templates. And since nginx is commonly used as the webserver or proxy you kind of get this functionality “for free.”
PS generating html by hand isn’t that bad though. You can either script it yourself or just have your own manual template html file that you base everything on, and/or use something like emmet/emmet-vim
That nginx thing looks pretty cool! Very neat (if using nginx).
In the second half you’re talking about dynamic imports right? Like fetching the html with JS and then loading that? I try and avoid doing that for various reasons
In the second half you’re talking about dynamic imports right? Like fetching the html with JS and then loading that? I try and avoid doing that for various reasons
I think I get you? No JS involved, no dynamic requests from the client side. Opening the page in a browser, you’d just see the one page request which arrives fully formed looking like static html.
If you mean my scripting and emmet comment, I just meant to script the creation of the static html then serving it. But not like programmatically, more like for file in ./blogs/$(date -I).*/*; docat$file >> ./blogs/$(date -I).serve-me.html; done or something (probably more rigorous than that, but that kind of mix of convention is semi automated hackery). I find non-commercial web pages don’t really need to change very much, so I’ll often just copy a header and footer into a file and fill in the middle manually. But I actually enjoy writing HTML. :9
I also try to avoid JS unless there’s something I really want to do with it. And then I like to offer a <noscript> alternative.
It’s not an only html solution, but I’m fond of using nginx server side v includes, which with a little setup let’s you do things
You can do simple things like set variables and import reusable html templates. And since nginx is commonly used as the webserver or proxy you kind of get this functionality “for free.”
PS generating html by hand isn’t that bad though. You can either script it yourself or just have your own manual template html file that you base everything on, and/or use something like emmet/emmet-vim
That nginx thing looks pretty cool! Very neat (if using nginx).
In the second half you’re talking about dynamic imports right? Like
fetching the html with JS and then loading that? I try and avoid doing that for various reasonsI think I get you? No JS involved, no dynamic requests from the client side. Opening the page in a browser, you’d just see the one page request which arrives fully formed looking like static html.
If you mean my scripting and emmet comment, I just meant to script the creation of the static html then serving it. But not like programmatically, more like
for file in ./blogs/$(date -I).*/*; do cat $file >> ./blogs/$(date -I).serve-me.html; doneor something (probably more rigorous than that, but that kind of mix of convention is semi automated hackery). I find non-commercial web pages don’t really need to change very much, so I’ll often just copy a header and footer into a file and fill in the middle manually. But I actually enjoy writing HTML. :9I also try to avoid JS unless there’s something I really want to do with it. And then I like to offer a <noscript> alternative.