17 |
19 | ${footer()} 20 |
Created at: ${new Date(created_when).toDateString()}
62 |Updated at: ${new Date(modified_when).toDateString()}
63 | 64 |Created at: Thu Oct 13 2022
100 |Updated at: Fri Oct 14 2022
101 | 102 |Created at: Sun Oct 02 2022
108 |Updated at: Fri Oct 14 2022
109 | 110 |Created at: Sun Oct 02 2022
116 |Updated at: Sun Oct 02 2022
117 | 118 |I want to create and edit blog posts simply from within Supernotes. And soon I can! (When you are reading this I definitely can.)
98 | 99 |I think blogging is fun. I can experiment with the tone of my written voice and improve my technical writing.
102 | 103 |I once setup a blog with Jekyll and GitHub Pages but the experience kinda sucked. I even wrote my very first blog post about that incident.
106 |Having it in Supernotes reduces mental load and friction a ton. I can start writing blog posts where I note down everything. It’s easy to refine thoughts into posts and I could publish any thought should I feel like it.
107 | 108 |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.
98 | 99 |Supernotes offers an API that I have build upon, yet it is to be considered in an alpha/beta stage.
102 | 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.
104 | 105 |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.)
108 |GitHub Actions to automate static file generation and GitHub Pages for static file hosting are the last two major components.
109 | 110 |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:
113 | 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.
115 | 116 |