Having the code and text both under both GPLv3+ and CC-BY-NC 4.0
was a bit confusing, and might not have been compatible with
the upstream code I'm copying.
Instead, I clarified that the site genration code is under the
GPLv3+ while the contents of the articles themselves are under
CC-BY-NC 4.0.
The images in mobile view were spilling out a bit; this commit
adjusts the margins to make it more mobile-friendly. In fact,
that part of the CSS is now "mobile first" with an exception
for devices thar are *larger* than a certain size 😉
The feed was still assuming the posts are stored as `title.html`,
whereas they are now stored as `title/index.html` or merely
`title/` for short.
Unfortunately, it looks like this part was a bit difficult to
customise so I ended up copying the entire module instead and
editing it in place :/
Traditionally, Haunt expects posts to be stored together in one
place, and other assets such as images to be stored separately.
However, I thought it'd be nice to store related images in the
same folder as the posts themselves, for easy access. A neat way
to do this is to have one folder per post, containing a file
index.md for the post content along with any related images.
Unfortunately, the Haunt reader complains when it finds files
with an unknown extension. To work around this, I've split the
default file filter into three variants:
- The default one, that only excludes things like hidden files
and is used for processing the actual static file directory
- A version that ignores images as well, to keep Haunt readers
happy
- A version that keeps images but ignores post files like `.md`
and `.sxml`, which is used for a new special inline-images
reader. This static file processor basically finds the static
files (i.e. images) that are embedded alongside the posts, and
copies those over to the rendered site.
I had written this a while ago, but only got around to publishing
it now. Incidentally, there's a bit of time-travel because I've
set the date to when I originally wrote it but the screenshots,
if you look at the date, are from images drawn quite a bit later.
Anyway, I'll leave it out there and see if anyone notices ;)
There's no need for them to be separate, and this makes the
max-width override cleaner. (We're setting a larger max-width in
the home page so that my entire name fits without wrapping, etc.,
whereas in posts it should wrap fast enough that we don't end up
with too-long lines.)
The 70em measure doesn't work because our 'M' is a bit wide, so
40em is a good amount that gets us closer to what we want. Hmm,
maybe the font size can also be increased a bit in this case?
This can now be done by putting code-only posts in a "clog" folder
instead of the customary "blog". To implement this, the code
checks the path of every file and matches the beginning with the
string "posts/clog/".
Other posts can be moved to a "blog" folder or kept outside as-is;
it doesn't make a difference because everything that is not in
"posts/clog/" is filed into the ordinary blog as a default.
It's now wrapped in its won function so that we don't have to load
it on every page. Also, we now have a way for any page to specify
what header content they need ;)
This makes them more reusable: for example, if we need two links
to be displaying the same image, we can just give them the
appropriate class instead of making a whole new style for each of
them.
Also changed the "writing" to my Snipette profile so that I don't
have multiple links going to the same page. In future, maybe I'll
change that to my non-code blog or something (if I start one).
The posts had to be mildly modified to work here:
- Field names were changed to lowercase in the metadata
- Times were set to 00:00, because Haunt's parser required times
and I had no clue what the actual times were supposed to be
- The Markdown poem had to be changed from using <del/> tags to
~strikethrough with a tilde~, because raw HTML blocks aren't
supported by the default guile-commonmark parser. Strikethrough
with tilde's isn't either, but I ended up creating my own fork
which [does have the option](https://git.disroot.org/badrihippo/guile-strickenmark).
- The "Category" field had to be remove because the parsen was
complaining about it :(
You can see the source for the original posts, if GitHub is
still around by the time you read this (or you have access to
their Arctic Vault or evil LLM memory or whatever) at the repo:
https://github.com/badrihippo/badrihippo.github.io
Well, not exactly "dynamic", but it does change depending on which
link you hover on. I was hoping to do it with pure CSS, but
unfortunately :has() support is still lacking so I had to add a
JavaScript version for backward compatibility (making the CSS
redundant in the process, but I've added it anyway)