This is still the header! Main site

Adding a sidebar

2021/05/14

... or... some kind of... bar... with links

I do like the idea of "writing HTML in HTML"; not dynamically updating everything is kind of cool, too. As for actual index pages... you could get away with updating just one of them (e.g. the top-level page), however, most visitors are unlikely to come from there (... I guess?), as opposed to the random links posted on various social media sites. Wouldn't it be nice to have a sidebar with related articles, on each page, updated automatically?

Which is, of course, impossible to do with a handwritten site: you'd need to update every page every time you add something, which would take enough effort for it not to happen, ever.

... or would you need to?

Enter iframes. A neater descendant of HTML frames, they come with the benefits (you can load a webpage into another webpage!), without most of the downsides (your site still consists of pages, not a weird frame structure that's impossible to link to).

So the idea is just to add the sidebar as an iframe, and each time you post an article, you add a link to it to a separate "page", which you then show in an iframe on every related article.

Now, you might have noticed that this page might not have an actual sidebar. This is due to the fact that CSS is nontrivial and creating a nice sidebar (... that transforms into a bottom bar on mobile) is a lot harder than adding a bottom bar that is, well, just a bottom bar, so us only having a bottom bar is still Working As Intended (I might come back and turn it into an actual sidebar later).

However, the concept works!

It's not quite perfect:

But!

This is post no. 9 for Kev Quirk's #100DaysToOffload challenge.

... comments welcome, either in email or on the (eventual) Mastodon post on Fosstodon.