Every blog website share a set of features, what I will have to create as well. For instance, for each blog post I will have to keep track of:
- Dates (both created and modified).
- A title.
- Short text (summary or similar).
- Post contents.
I also need to create static URLs for each post, so my future readers can link to them.
For the points above, I will rely on the markdown files themselves for now. Created and modified dates can be read from the filesystem, the title will be the very first line of the file and the short teaser text will be the first 100 characters (minus the title).
That should be enough to get started, but I might run into trouble later on when I have to deal with tags and cross linking. We'll cross that bridge when we get to it.
I will completely ignore the following features for now:
- User management
- Commenting
- Search
- RSS
Some of those points might be revisited later, but for now I'll do without.
Technical features
To keep things as simple as possible, I'll start by looking into generating static sites. A whole bunch of tools already exist for generating static sites, but I will create my own.
I won't be building everything from scratch, though. markdig seems like a great tool for generating HTML from markdown files. Combined with a homegrown templating system, I should end up with something useable while still being relatively simple.
When all the static HTML files have been created, I need a webserver to serve them.
While toying with different container images on my home server, I have fallen in love with the power and simplicity of Caddy server. The automatic HTTPS is a nice feature, but not one I will be needing here.
To sum it all up, the to do-list currently looks like this:
- Create a basic HTML template and general style sheet.
- Create console app to generate static HTML files using markdig and a homegrown templating system.
- Bake it all into a Caddy docker image, serving static HTML files on a specified port.
Oh, and I also updated the directory structure so each post will exist in a separate directory. It should help prevent cluttering:
