Elektrine lite

← Feed

@jimniels@mastodon.social

Post #2004563

2026-05-04 04:37 UTC

📝 Post-mortem on my "lots of little HTML pages" approach — still like it. The browser's most basic feature is following a link. What if you built a site’s interactions around just that? e.g. a "menu" could just be: <a href="/menu/"> and a dash of CSS view transitions for flair. https://blog.jim-nielsen.com/2026/small-html-pages/

Replies (5)

  • @martingwd@mastodon.social 2026-05-04 04:49

    @jimniels love this super elegant solution, thank you for sharing Jim!

    Open ##2019168

  • @nickchomey@mastodon.social 2026-05-04 12:16

    @jimniels I came across this post on HN. it's a nice instinct to try to be js-free, but then you're just using js to manipulate your history, which is surely far more blasphemous than a sprinkling of js to show/hide a menu. Especially when you're doing a full nav for this. I beg you to check out Datastar. It's precisely what you're looking for. It's more powerful than htmx + alpine js, and smaller than both. You could just have a few declarative html attributes that show/hide the menu.

    Open ##2019169

  • @cjoly@hachyderm.io 2026-05-04 14:32

    @jimniels Thanks for documenting this trick! I had such a menu on a separate page on my own website for a while, but I grew tired of it. I ended up just putting back 5 links at the top. Ultimately, it’s a personal website, it boils down to personal preference. I’m of course not saying your approach is wrong. I certainly wish more website adopted it instead of cascading expand on hover from hell. Anyway, I ended up reading a bunch of other posts and subscribing to the RSS feed. Thanks for building this blog, I really enjoy it!

    Open ##2019174

  • @konform@techhub.social 2026-05-04 22:06

    @jimniels For simple inlineable content like a menu, I think you can do even better in pure CSS and hiding/showing it using attribute selectors. Smoother UX since you don't need to trigger navigation and can forego JS alltogether without degradation. https://stackoverflow.com/a/33528185 Using a variation of this on Konform Browser front page to dynamically toggle display of installation instructions for the target selected by user with CSS only: https://konform-browser.codeberg.page/ #nojs #css

    Open ##2019175

  • @loucyx@mastodon.social 2026-05-05 05:42

    @jimniels it’s also worth mentioning you can get a menu with no JS and a single HTML by using the Invoker Commands API, which is already baseline. Nowadays we can do almost anything without using JS on the client side 💖

    Open ##2019176