static page generator

May 18, 2021

A blog using a simpe static generator has been taunted on. Here I am with one generated by Gatsby and I love it!

Generating static pages with separated content and style has been around for a score years: mainly xml and xslt. Writing blog in xml would be painful with all the elements to remember.

Enter markdown. With various flavour, it’s quite good for coders like me where code examples can be written as it’s built into the format. However, table formatting is not easy and I haven’t had any need to a few years in blogging.

Then there’s mdx. Markdown with JSX. It might help with table content.

Gatsby / GitHub

I decided to go with Gatsby. I was comparing xml + xslt and I am blown away with plug-ins provided by Gatsby. GraphQL integration provides exploring plugin values and integrating to React components. That is, querying for static files and surfacing them as a blog… it’s pretty neat. This allows me to place blog content in git and sent to Github. A blog with Github as CMS. File history may not be useful but provides easy editing.

Efficiency

A decade ago I read about file caching, it has been greatly exploited by Lucean search tool where searching content bringing it up to the OS to cache file was simpler than building a custom cache.

A static site is exactly that. Web server can cache the most read file then avoid caching on the rest. Excluding web crawlers, only code reference items would be re-visited.

Although database would query for the primary key, primary keys would be loaded in memory causing it to be cached.

Code formatting

Adding code snippets has been the most frustration and markdown document is now my second nature, markdown content is a bonus for me.

Migration and new problems.

I have exported old posts which I plan to resurface them here. First, I have to build a few things:

  • pager
  • search
  • style

Fun and busy days ahead!


© 2023 Kee Nam