←back to thread

210 points Evidlo | 1 comments | | HN request time: 0s | source

(spoiler: its XSLT)

I've been working on a little demo for how to avoid copy-pasting header/footer boilerplate on a simple static webpage. My goal is to approximate the experience of Jekyll/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

  <?xml version="1.0"?>
  <?xml-stylesheet type="text/xsl" href="/template.xsl"?>
  <page>
      <title>My Article</title>
      <content>
          some content
          <ul>
              <li>hello</li>
              <li>hello</li>
          </ul>
      </content>
  </page>
Some properties which set this approach apart from other methods:

  - no build step (no need to setup Jekyll on the client or configure Github/Gitlab actions)
  - works on any webserver (e.g. as opposed to server-side includes, actions)
  - normal looking URLs (e.g. `example.com/foobar` as opposed to `example.com/#page=foobar`)
There'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.

[0]: https://news.ycombinator.com/item?id=44952185

See also: grug-brain XSLT https://news.ycombinator.com/item?id=44393817

Show context
shakna ◴[] No.44991280[source]
As of the next version of Chrome, XSLT will be gated behind a flag.

Google have also asked for it to be removed from the standard [0].

[0] https://github.com/WHATWG/html/issues/11523

replies(5): >>44991471 #>>44991489 #>>44991500 #>>44991526 #>>44992056 #
SnuffBox ◴[] No.44991500[source]
I find it bizarre that Google can just ask for a feature to be removed from standard and nobody bats an eye.
replies(6): >>44991546 #>>44992072 #>>44992210 #>>44992387 #>>44992424 #>>44994991 #
chrismorgan ◴[] No.44992210[source]
> nobody bats an eye

I’ve seen a lot of eye-batting about this. Although Google, Mozilla and Apple are all in favour of removing it, there’s been a lot of backlash from developers.

replies(1): >>44992793 #
johncolanduoni ◴[] No.44992793[source]
Most of whom had never heard of XSLT before today - some were likely born after it had faded into obscurity. I don’t blame people for hating Google for whatever reason, but this is a weird way to try to stick it to them.
replies(2): >>44994843 #>>44995108 #
sunaookami ◴[] No.44994843[source]
XSLT is widely used, for example by the US congress: https://simonwillison.net/2025/Aug/19/xslt/
replies(1): >>44995506 #
lucumo ◴[] No.44995506[source]
Neither you nor the blog posts author had heard of that before that ridiculous GitHub issue from yesterday. You're all using the exact same link to the exact same page. This is intellectual dishonesty from you, the blog post author and the issue reporter.

Anyone who has read the response to the reporter knows that this is a cherry-picked alternative format. The normal format is an HTML5 page. Search engines just return that instead, so the only way to have found this page is by clicking through that.

replies(1): >>44995699 #
sunaookami ◴[] No.44995699[source]
So "it doesn't matter because other people already posted this example"?
replies(2): >>44997557 #>>44999267 #
lucumo ◴[] No.44997557[source]
Is your intellectual dishonesty professional, or just a hobby?
replies(1): >>45003873 #
sunaookami ◴[] No.45003873[source]
So no arguments, got it.
replies(1): >>45010850 #
1. lucumo ◴[] No.45010850[source]
Oh no, I have arguments. But you'd just pretend I said something else, so I see no point.