SilvanBlogs


SuperBlog: The ingredients

So, as you may have read, the source of this article is my Supernotes. I decided to turn this experiment into a little series, where I discuss the technical implementation and explore its capabilities.

Where does it come from?

Supernotes offers an API that I have build upon, yet it is to be considered in an alpha/beta stage.
The only official docs is swagger at https://api.supernotes.app/docs/swagger which by far does not explain itself in detail and there are no guarantees regarding stability.

I hopped into VSCode, generated a . devcontainer configuration for deno and prototyped the API calls with Typescript. The API and especially the types (I love types!) of the JSON responses turned out sufficiently complete, enough for me to figure out how to read and write my cards and their metadata as needed.

Where does it go?

We as individuals got pretty powerful platforms at our fingertips these days. GitHub is one of them. Having my card data available I blew some magic powder in the air and they turned into HTML. (The content is actually available as HTML right away and most of the code is just template strings to stitch that together. Also the index page is generated.)

GitHub Actions to automate static file generation and GitHub Pages for static file hosting are the last two major components.

Why are you telling me this?

I think I got a potentially clever idea that could benefit you as well. (Assuming you do or would want to use Supernotes.) And in any case, you and me, we might learn something. So listen:
The input for all that blog generation seems reasonably small to me. So small, in fact, I believe I can turn this thing into a GitHub Action itself. Right now I approximate the smallest possible input for that potential action as an token to access the API and one tag to find relevant cards. From there it depends how customizable the output needs to be to be satisfactory as an individual blog.

Thank you for spending your time with me and stay tuned for more.