Your cat is not available now, please call back later
CAT'S BLOG

How to make a blog

2025 version

So, you ever wanted to start writing texts, but don't know how to start? You've looked through the existing list of blogging engines and could not find anything that suits your needs? Or.. you want to self-host your own blogging platform?

I'll share some of my experience here.

Choosing between static pages and dynamic generation

I've been choosing between two sides: - Dynamic rendering powered by server or web browser. It can be simple python/go/java/php/bash page generator or client-side javascript that fetches data from remote server. - Static files, generated once and served from my server or CDN.

So, I've chosen static files and decided to power it by forgejo actions and a pile of autism.

Plan is: implement something that can render pages and something that can serve files and provide insights about page views and basic analytics.

Here is the plan.svg:

pipeline.png
beware of the pipeline.png


Silly Language Model

At first, I write some text in raw (or well done) markdown. I'm still learning how to write good text and I know that the only way to do so is practice. But this is the first post.. (second, mind the bongo cat).

Anyway, more practice will get me into better writing (once).

Git

Second part is not complicated at all. All data is stored structured and pushed into git repo. I use selfhosted forgejo instance and have forgejo actions on top to trigger deployment, but you can use github, gutlab, codeberg, gitanything.

You may also use google drive or a regular file system to store your files.

Anyway, I would suggest to try using git just because you can view a history of changes, add actions and use simple instruments for contribution: you do not need advanced UI, content management systems or even frontend. Just use any favourite text editor.

Render

When it comes to render part, I actually choose difficult way.

You can use existing tools that can generate HTML from markdown with cusom CSS, use existing blogging engine or just atach markdown renderer javascript on web page and pull files from github pages and transform them on the fly.

That's why I've decided to write custom python tool to generate pages and it is very simple: - Take templates from templates: for pages, errors, indesex and everything else; - Take post text and metadata from posts - Each page supported by frontmatter with useleful metadata like page tags, html meta tags, opengraph tags, twitter tags and everything else used in page - Generate tag index pages: - tags - list all tags in system - posts/tag - all posts by specific tag with paginator - Generate post listings: - posts - lists all posts in blog with paginator - Finally, generate posts using post template and frontmatter - Copy media and static pages

So, you have saved files somewhere, rendered themm and... so what?

Deploy

here we are. Don't be scared. It's fine. We are going to talk about static files deployment.

There are lots of options how to serve static files. You may put them in github pages and update by pushing files to the repo. You can also store files in google drive and share static link (I wouldn't recomment that). Or use selfhosted nginx to serve static files. That's all you neded, but..

For me nginx is not enough - that's why I made a simple server in go for a purpuse: - Each new user is assignd a uniue cookie used for session trackng and user activity measurement. Simply talking, I track how many unique users visit my blog; - Each file, page, object, whatever hit is logged wwith a cookie and I have a nice and shiny postgres with all data stored inside and grafana dashboard.

Simple, works and that's all.

Here is nginx asset that I've drawn and forgot to add:

selfhost.png

>^~^<

Last modified at 2026-01-20 23:53:26 UTC