build_a_blog: rm index.xml, intro

This commit is contained in:
Collin Lefeber 2024-06-17 23:02:33 -04:00
parent 3519112157
commit 7cdfee36fc
3 changed files with 15 additions and 525 deletions

View file

@ -3,9 +3,17 @@ Date: 2024-06-17T14:46:36-04:00
---
I want to share my thought process for how to go about building a static blog generator from scratch.
The goal is to take 1 afternoon + caffeine + some DIY spirit → _something_ resembling a static site/blog generator.
There will be nothing ground breaking here - in fact this software will not be good. So turn back now if you're expecting the new [Hugo][hugo].
Lets see how hard this will be. Here's what a blog is/requirements:
Actually you should probably stop reading and just use [Hugo][Hugo].
In case you are still interested, the goal is to take 1 afternoon + caffeine + some DIY spirit → _something_ resembling a static site/blog generator.
And I hope by the end of this post you might be inspired to build your own generation scripts, maybe in a new language you always wanted to try.
Lets see how hard this will be.
Here are the requirements for this blog:
* Generate an index with recent list of posts.
* Generate each individual post written in markdown -> html
@ -23,10 +31,12 @@ So there is 1 "exotic" feature in parsing/rendering Markdown as HTML that will n
The rest is just file and string manipulation.
Most scripting languages would be fine tools for this task. But how to handle Markdown?
Lets get it on.
## Picking the tool for the job
Most scripting languages would be fine tools for this task. But how to handle Markdown?
I've had [Crystal][1] in the back of my mind for this task. It is a nice general purpose language that included Markdown in the stdlib! But unfortunately Markdown was removed in [0.31.0][2]. Other than that, I'm not sure any other languages include a well rounded Markdown implementation out of the box.
I'll likely end up building the site in docker with an alpine image down the road, so just a quick search in alpines repos to see what could be useful:
@ -645,3 +655,4 @@ Or the full repo tree: <https://git.sr.ht/~cfebs/cfebs.srht.site/tree>
[4]: https://python-markdown.github.io/
[5]: https://archlinux.org/packages/extra/any/python-markdown/
[hugo]: https://gohugo.io/
[jekyll]: https://gohugo.io/