Work Journals

  • Weighing the options

    Have been working on a Eleventy sample website to showcase Notion CMS today. There are two ways to pull in content from the outside, one is sort of hacky and limited, the other is sort of detouring.

    I find myself constantly be in the situation of wanting to use a tool differently to how it was designed in the first place without knowing that, and found out about it after digging deeper to the fundamentals. I guess this is just how my brain works.

  • Not much progress

    Just like the good ol' saying - "Starting things are easy, finishing them are the hard part." The straight forward parts of Notion CMS for me are done, now comes the tedious and unfamiliar parts, fixing bugs, improvements, marketing, and etc.

    I am thinking of using Tailwind CSS for the mandatory styling part of Notion CMS. It is kind of making it an opinionated library, but I think it makes it easier to use.

    super.so has constantly come up my mind recently, as it is doing something like Notion CMS, but much better, and way earlier before Notion released the API. I guess it crawls user's notion pages since it requires user to share the pages publicly. Maybe I should just do the same.

  • First user

    🎉 My commonplace book is now powered by Notion! It is using the notion-cms NPM package which I created to use Notion as a content management system for websites built with static site generators.

    I jot down takeaways from inspiring podcasts, videos, and blogs on my website, but oftentimes I don't have access to my computer while I am listening to podcasts.

    Notion released its API a while ago, and it make sense to just use the popular tool to write down thoughts, and have them automatically got processed into my website. And I thought, "Why not just make a tool that every one can use?".

    notion-cms is currently crafted in the way that it fits my needs. I'll share it around and see how people could find it useful.

  • Almost there

    So the Notion CMS NodeJS package is just one feature away before I can use it on my website. I think I can share the repo tomorrow if things go well, and some showcases and articles after that.

    Played around with jest for a while today, I wonder if it is that the document does not make it clear how to mock a Node class module, or is it just me.

  • Need just some more work

    JavaScript module is a mess, but on the other hand mind-blowing that the language still rule the world. To make a NPM package support both ESM and CJS module, you have to write the main code base in CJS with a thin layer of ES6 along side, the other way around doesn't work.

    Figured out the proper way to integrate the library into Eleventy, need to propagate some metadata from Notion API and handle pagination before it becomes usable. Working on these stuff truly brings back the days building KKBOX Open API.

  • Had a basic prototype

    Had a basic NodeJS script that turn pages in a Notion database into HTML documents. There are a lot of missing pieces now for sure, but at least it is a start. I want to turn it into a more general tool, but I don't have specific ideas for now.

    I'm wrapping it up into a NPM package, will try it on my commonplacebook and hopefully will able to publish the package tomorrow.

  • Depth-First Searching the Notion

    Keep working on the NodeJS code to convert Notion API's response into HTML, it is all about depth-first searching the tree. The idea to have children for each block is something that cannot be directly trasnlate into HTML, I guess I'll need to use CSS to visualize the structure.

    I think I can start integrate it into Eleventy tomorrow.

  • Initial Commit

    Started to play around with Notion's beta API a few days ago. It feels like a great fit to jot down my commonplace book content in Notion, and use the API to pull content into my blog. Yes, just like a CMS.

    Here's what I've done so far

    • Created a Open API spec for Notion's API
    • Started writing some NodeJS code to generate HTML from API response