Journal : 2024-05-03
I've quite a lot of prep for #FOAFarchive but have paused content-collection/generation until I've got things in place to organise and present it. I'm on the last mile for those - bottleneck predictably being some of my own code. Yes, it is kinda yak shaving, but the code should be a bean with which I feed a lot more birds (if you're reading this, that's one of them fed).
I set an alarm for 9:00 every morning but takes me a while to get moving. Usually I start with a pee, then back to bed for a bit of BBC Radio 4 Today programme. I rediscovered a thermos flask a couple of days ago, so I've been having coffee in bed. Overriding my main reason for getting out of bed. This morning, random YouTube video recommendations.
Fortuitous. The next task (after resolving current #Transmissions #Unfork issues) for the #Postcraft site generator is to sort out templating. It's a few years since I last did any in #JavaScript when I used Hogan, it did all I needed. Dead easy - moustache-based - relatively small lib. JS native Template Literals have come along since then, but they still look a bit of a pain. Even though I don't need much for Postcraft, I'd still have to start going down the path of writing yet another templating engine. So I have been kicking the can down the road.
Fortuitous random YouTube video recommendation: Eleventy: Key Features and Getting Started. It's a JS static site generator. I've only really skimmed other ones, and my dev of Postcraft has been quite chaotic as I've concurrently been figuring out the underlying #Transmissions setup. #Eleventy looks like it has features I may want to lift later. But what caught my eye was mention of Nunjucks templating, which looks like a good fit for Postcraft. It appears to have everything Hogan had, plus a load more, like template pre-compiling. I won't need that for Postcraft, which will essentially do server-side rendering using a Bake, Don't Fry strategy, but it's nice to have in the back pocket.
Install is the usual :
$ npm install nunjucks
The first examples use require('nunjucks') syntax, I want ES6 import syntax, hopefully that'll be ok.
Mari's helping a friend at the hospital this morning but is going to message me when done.
The night before last I started a new tune in the music room. I am trying to finish more like what I start, but I'd got a bit blocked so needed something fresh. Stumbled on the tune 'Silver Legs', a cover of that is perfect.
Weather's been wet, could go either way today, but I doubt there's much fun to be had outside. There's always tidying I should do, but then there's also putting up some more holds for my kitchen climbing wall, much more fun...
So now I have :
PLAN 2024-05-03
- [*] Freshen up, find some clean clothes (eek! - there's still a soggy load in the machine from the other day)
- Resolve current #Transmissions #Unfork issues
- [*] Coffee out, shopping
- [*] Try Nunjucks templating in Postcraft
- [*] Dogwalk
- [*] Music room : 'Silver Legs'
PS. When I fired up Transmissions it was failing earlier in the pipeline. Coding when tired, eh. So I went throught it again from the start, step by step. When I got to the Templating service, the placeholder code I'd put in there wasn't very helpful, so I decided to have a quick go with #Nunjucks. I got it basically working quickly enough, but while looking at the docs saw that I should be able to use it better. So I'm looking again at the structure of my pipeline, better strategy.