{"by":"Evidlo","descendants":114,"id":44988271,"kids":[44993928,44992355,44991654,44991280,44993067,44993731,44996720,44991535,44991303,44991549,44994328,44992220,44991233,44991822,44994630,44994640,44991194,44994389,44994900,44994463,44991161,44991820],"score":211,"text":"(spoiler: its XSLT)<p>I&#x27;ve been working on a little demo for how to avoid copy-pasting header&#x2F;footer boilerplate on a simple static webpage. My goal is to approximate the experience of Jekyll&#x2F;Hugo but eliminate the need for a build step before publishing. This demo shows how to get basic templating features with XSL so you could write a blog post which looks like<p><pre><code>  &lt;?xml version=&quot;1.0&quot;?&gt;\n  &lt;?xml-stylesheet type=&quot;text&#x2F;xsl&quot; href=&quot;&#x2F;template.xsl&quot;?&gt;\n  &lt;page&gt;\n      &lt;title&gt;My Article&lt;&#x2F;title&gt;\n      &lt;content&gt;\n          some content\n          &lt;ul&gt;\n              &lt;li&gt;hello&lt;&#x2F;li&gt;\n              &lt;li&gt;hello&lt;&#x2F;li&gt;\n          &lt;&#x2F;ul&gt;\n      &lt;&#x2F;content&gt;\n  &lt;&#x2F;page&gt;\n</code></pre>\nSome properties which set this approach apart from other methods:<p><pre><code>  - no build step (no need to setup Jekyll on the client or configure Github&#x2F;Gitlab actions)\n  - works on any webserver (e.g. as opposed to server-side includes, actions)\n  - normal looking URLs (e.g. `example.com&#x2F;foobar` as opposed to `example.com&#x2F;#page=foobar`)\n</code></pre>\nThere&#x27;s been some talk about removing XSLT support from the HTML spec [0], so I figured I would show this proof of concept while it still works.<p>[0]: <a href=\"https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=44952185\">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=44952185</a><p>See also: grug-brain XSLT <a href=\"https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=44393817\">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=44393817</a>","time":1755888450,"title":"Show HN: JavaScript-free (X)HTML Includes","type":"story","url":"https://github.com/Evidlo/xsl-website"}