suntdoar.eu

Introduction

Written on , last updated on

I’ve finally moved on from my old, homemade blog, and I’m now using Jekyll.

Why did I do that? The reason is simple:

It took me a lot of time to write a post and it actually made writing less enjoyable, ironically. Let me explain.

How my old blog worked

I wanted to build my own static site generator from scratch.

I used Python for that. I had a script called build.py that would read all the files in the post/ directory and generate a index.html file that would contain all the posts.

Then, I had the idea to introduce templates and components.

Templates would be the base of the page, and components would be the parts of code that would be reused in multiple pages, such as custom links, horizontal rules, images, and so on.

For example, the link.html component would look like this:

<!-- link.html -->
<a href="$1$" class="text-dark" target="_blank">$2$</a>

And to use it, I would write this in my post:

<!-- post.html -->
Meet <mylink(https://github.com/extremq/float|float)/>.

The builder split the text between the paranthesis by the | character, and then it would replace the $1$ and $2$ with the first and second element of the array.

It worked well. It was great. In theory, it was a recursive system that could be used to create any kind of page.

But in practice, it was so annoying to write a post. I had to write the HTML code myself, and I had to remember all the components I had.

The ugly part

<br>.

<br><br><br>.

That was like 50% of my posts.

br

Not fun.

Not only that, but Visual Studio Code would always try and close the HTML tags (<a></a>) even though all my components were just a singular closed tag (<mycomponent/>).

And it didn’t stop there:

  • The date was hardcoded as an UNIX timestamp because I was too lazy to implement a date parser. My god, even something like 2023-05-20 would have been better.
  • I had to run the builder every time I wanted to see the changes I made. I also had to refresh the page. I didn’t know how to use a daemon to do that for me.
  • The styling was based on Bootstrap. It didn’t exactly fit my needs, but I didn’t want to write my own CSS. That made it hard to customize the site.

So I’m glad I moved on.

The new blog

This new blog is based on Jekyll—everyone was praising it:

Oh, it’s so easy to use! You just write a post in Markdown and it’s done!

You can just use a theme and you’re good to go!

It’s so easy to customize!

Ehh… It wasn’t that easy.

For example, themes. I never used Ruby before. It was easy to install jekyll, but because of the Gemfile.lock file in the themes’ repositories, I just couldn’t run bundle install. I randomly found an issue on GitHub that said I should delete the Gemfile.lock file and run bundle install again and suddenly, every theme worked! I wasted a lot of time on that, sadly.

Customization was okay-ish because I knew CSS, but I had to rely on Github Copilot a lot. Fortunately, I settled on the thing you see before your eyes and I’m happy with it.

It’s fine, though! I’m actually pleased with the result. I recommend Jekyll to anyone who wants to start a blog. By the way, the theme is called Dark Poole but with some tweaks added.

Hosting

I’m hosting this using Vercel. It’s free and it’s a CI/CD service. I just push my code to GitHub and Vercel builds and deploys the site for me. It’s great!

I bought this domain from GoDaddy. Since I am an EU citizen, I could get it really cheap and it has domain privacy included. Less money for GoDaddy, more money for me!

Conclusion

All in all, this has been a smooth transition. I’m ready to share some of my new projects with you.