After much delaying, I have finally started on my bascule in the cloud project. The past couple of months I've been distracting myself with developing and Android app, and that remains a priority. But over the Christmas break, I have taken the plunge and started on the cloud project. The bascule name has too much legacy, for me at least, so I am starting afresh with Cantilever (please ignore a previous unrelated project with that name!).

So far I've focused on setting up the cloud infrastructure (using AWS's CDK). My goal is to have all the processing running as AWS lambda functions. And a secondary goal is to break up the messy confusion that became bascule. I still can't remember how that project is structured, after all this time...

So, how does Cantilever work? Or rather, how will it work?

  • Upload a markdown source file to an S3 source bucket
  • Which triggers a lambda function which will do an initial review of the file - is it markdown, what metadata/front-matter is provided, that sort of thing.
  • With a valid, relevant markdown file, send put its details to an SQS queue
  • A Markdown processor lambda function will consume messages on that SQS queue, calling the flexmark-java library to convert the markdown into a fragment of HTML
  • after which things get a little hazy, but something like...
  • the HTML fragment is passed to another function, perhaps via another queue
  • which will build a complete web page using a handlebars template and the metadata/frontispiece from the original source file
  • the final HTML will be written to the destination HTML bucket, set up as a static website

This misses a big chunk of what bascule used to do - bascule scanned the entire project markdown files, and built a navigation structure around it. This was fed into the handlebars templates to build the home page, an archives page, dynamic custom tagging, a sitemap.xml file and more. And that's often where bascule got too complicated.

My current ill-defined thought is to handle navigation purely in browser javascript - the handlebars templates would inject a bit of javascript, and a JSON project file, into the HTML, and the browser would build the navigation on the fly.

It's just a thought, and a long way away. I may have to take a different approach. But we shall see. Breaking up bascule into smaller, independent processes, is a key goal. I'll definitely not be doing the clever runtime loading of custom bascule plugins.