snippets.bentasker.co.uk is currently created with my home-grown PHP static site generator.
However, it's now years old and I'd like to replace it with something more modern.
My intention is to migrate to Nikola just like I did with my recipes site.
But, most of my snippets usage happens via a custom cli:
sbt_cli foo
That CLI relies on fetching the JSON sitemap that my SSG generates. No other SSG generates one of these. Whilst I could create a Nikola plugin to generate a compatible file, it would seem to make more sense to create a new utility which consumes a RSS feed.
The old CLI was in Python, but I've elected to write this in Go - there's no other reason for that than that I fancied doing it in Go.
The Python CLI has a number of features, not all of which are intended for the initial Go implementation
search
: My primary mode of interaction is searching[number]
: Output snippet with id (see note below)list
: list all snippets in the system (not implemented because I've never used it)The old implementation leans quite heavily on IDs - each snippet is given an ID at generation time.
Whilst we could (and probably will, come import time) expand the front-matter fed into Nikola to include these they'll still not be available via the RSS feed.
So, if we want to use IDs as a means of specifying a snippet they'll need to be assigned deterministically by the CLI
The old CLI retrieves a JSON object describing the snippet and then constructs output section by section.
We won't be able to do that - we'll have to process HTML and reformat into something CLI friendly.
We can get that HTML from one of two sources
Activity
27-Sep-24 08:03
assigned to @btasker
27-Sep-24 15:00
I think we're now more or less at parity with the features that I actually use with a couple of extras thrown in
www.bentasker.co.uk
andrecipebook.bentasker.co.uk
depending on the binary name (see #8)What we're lacking, of course, is the ability to search my snippets site because I haven't done the migration yet.