Architecture
This blog is a static site (see also jamstack.org), using the Astro framework with the AstroPaper theme courtesy of Sat Naing.
why Astro?
Between Hugo (another excellent SSG) and Astro, I think Astro will provide me with the easiest way of creating custom components in the future. With Astro, it is also super easy to use mdx to add some interactivity to the site. I also checked out Ghost, but didn’t like the fact that I need an actual compute server to run it.
why use the AstroPaper template?
I didn’t want to spend to much time comparing themes, so I picked a popular one. The following features were important to me:
- written mostly in pure astro
- dark/light themes
- code blocks with a copy button that have syntax highlighting and also follow dark/light mode
- rss feed built in
- good image handling
- search built in
Also using:
- GitLab for content and site configuration
- Cloudflare Pages for building and hosting the static site
Initial setup of the website
Pre-requisites: git and nodejs installed, git is authenticated with GitHub
-
Use the AstroPaper theme as a template:
- https://github.com/satnaing/astro-paper
- using a template in github will squash all commits of the source repo at that point in time and commit it as “Initial commit” and only have a single branch “main”
- I added a skill to the repo to track upstream changed
- AI was used heavily to customize the site afterwards
-
Clone repo locally, install dependencies and run it locally
npm install npm run dev -
Update
astro-paper.config.tswith the public url, commit and push -
Connect Cloudflare Pages to GitLab, select the Astro preset and create a new site based on your repo, basically all the defaults are okay, at the end, also set the custom domain.
-
You should see the site public fairly quickly, didn’t take more than a minute for me.
-
Clean up and customization
- Delete all content from the template site and add hello world post to test the auto deployment mech.
- Clean up the rest of the repo, by deleting more config files I don’t need.
- Update
astro-paper.config.tswith more basic site info