Tuesday | 21 MAY 2024
[ previous ]
[ next ]

Adding Tags to the Blog

Title:
Date: 2023-06-13
Tags:  blog

I've now added tags to my blog. This was a feature that I had wanted to add for awhile but never got around to doing. The implementation required a few different things. I was already using tags in my front matter so it was really a process of parsing it out.

I updated my RENDER.GEMTEXT function to handle tags and it would now write out files that had tags to a specific TAGS-FILE. I really need to rename RENDER.GEMTEXT as I am not really using gemtext.

The next step was to the create a BUILD.TAGS program that would select the TAGS-FILE and create each page and an index page. This involved moving my header and footer templates into a general subroutine so that I can call it from my BUILD.BLOG program and BUILD.TAGS program.

The goal is to eventually do this with templating instead and to remove the need for various subroutines that give out html.

The final step was to update my BUILD.BLOG routine to swap out the tags for their html links.

Now I have tags working! A future goal is going to be to add tags to words in the body of my markdown. This is going to be a bit harder. I'm imagining something like writing {Oshi No Ko} [Oshi No Ko,anime,recommendations]. This should link that word to both tags and on hover show me the tags. I would also like to be able to quickly link to a {specific page in my blog like} [Importing JSON in the Browser]. This should then add a link to that article.

Now that I'm working on it this is just markdown linking which I should get wired up as well. This is going to fly in the face of gemtext because it is no longer line oriented.

Maybe on hover the text should appear on the side of my blog. The goal is for this to work on my desktop mostly. It is also all largely for me so that I could make connections easier.

I could also see a reason to have connected tags and thier content appear in the sides of my blog.