by fergie · 1mo ago · 0 comments
Hence HTML as a mere vocabulary making use of SGML's facilities didn't need to define its own ad-hoc mechanism.
Btw the <?php ...> construct is also derived from SGML. In SGML terms it's a "processing instruction" rather than an "entity reference", the latter being the basic means for content inclusion.
I say tragically, because XSLT was indeed the only sort-of workaround that was available for templating in the browser, even if it was limited to v1 rather than the much more useful v2 and v3.
https://web.dev/articles/imports
Been there, tried that.
Introduced in 2014 (Chrome 36) Deprecated 2018 (Chrome 70) Retired 2019 (Chrome 73)
<!-- #include file="header.html" -->
https://en.wikipedia.org/wiki/Server_Side_IncludesWhy is there no direct support for templating in HTML itself?
This might be the worst argument for anything I've read this week, there's got to be a name for this logical fallacy
Eg some template feature creates a security issue and has to be disabled, which invalidates all the old HTML that used it.
There’s also just not a super great reason to do it. It’s not all that different from pre-templating like Hugo or doing it server-side like Django. You get to offload some compute, but HTML templating isn’t usually the bottleneck.
No offense but this is a bit of a non-argument that could be applied to just about any development in HTML.
> There’s also just not a super great reason to do it.
Most web dev frameworks exist in large part to solve the problem of templating. (yes, they do other stuff, but templating is the central problem that they are solving)