this post was submitted on 18 Jul 2026
43 points (95.7% liked)

Technology

42961 readers
304 users here now

This is the official technology community of Lemmy.ml for all news related to creation and use of technology, and to facilitate civil, meaningful discussion around it.


Ask in DM before posting product reviews or ads. All such posts otherwise are subject to removal.


Rules:

1: All Lemmy rules apply

2: Do not post low effort posts

3: NEVER post naziped*gore stuff

4: Always post article URLs or their archived version URLs as sources, NOT screenshots. Help the blind users.

5: personal rants of Big Tech CEOs like Elon Musk are unwelcome (does not include posts about their companies affecting wide range of people)

6: no advertisement posts unless verified as legitimate and non-exploitative/non-consumerist

7: crypto related posts, unless essential, are disallowed

founded 7 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] grrgyle@slrpnk.net 2 points 1 day ago (1 children)

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

[–] Zarobi@aussie.zone 1 points 1 day ago (1 children)

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

[–] grrgyle@slrpnk.net 2 points 21 hours ago* (last edited 21 hours ago)

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).*/*; do cat $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 alternative.