Rewriting my website in Astro

#website #meta
Published on 14/03/2024

It’s been a week since I started rewriting my personal website in Astro. I have to say it, I’m really enjoying this framework. But it’s not been a smooth experience, here’s some thoughts about it.

History

Let’s start from the beginning, this is my fourth time writing my website (giopan.dev v4, if you will). Here’s a quick summary of the previous versions:

  1. Static HTML/CSS
  2. NextJS
  3. Laravel
  4. Astro, this one

The first version

The static version was hosted on a CPanel website I used to have, my very first public web server. It was… something. It was really easy to use and configure for a static website, but the moment you wanted something more, it would become a nightmare. I tried writing some PHP, but it was impossible to use any Composer package and I used to always occur in some strange configuration bug (probably caused by my inexperience).

Screenshot of the hero in the homepage Screenshot of the homepage

The second version

Some time passed and I discovered the magic world of NodeJS and NextJS, and that’s when I decided to rewrite my portfolio. I also decided to rent a server on Akamai (former Linode, here’s a referral link that will give you 100$ credit for 60 days :wink: :wink:), this version worked fine… until I tried to deploy more websites on the same VPS and the RAM usage spiked to 90%. Nice, NodeJS at its finest.

The source code of the website should still be online here

The third version

The third version was the longest-lived one so far, I discovered Laravel and I wanted to experiment with it, so v3 arrived. I had fun and all but, a Laravel website that has 2 pages and a blog, with a custom authentication system, a MySQL backend AND Redis for caching “just in case”… Yeah it was pretty overkill.

But this website had something truly beautiful: you could visit the website with curl and view a terminal friendly version of it. If you visited a post page it returned the markdown version and every other page had a text version + some decoration using bash formatting. Doing this was fairly easy, I had a laravel middleware that read the User-Agent HTTP header and handled the request accordingly returing a text-only view of the page. Honestly, it was amazing. I had some issues with the view caching of Laravel but I quickly resolved it.

Screenshot of the homepage of the website viewed via curl Screenshot of the blog page of the website viewed via curl Screenshot of the a post of the website viewed via curl

The source code of the website should still be online here

The present

The first time I heard about Astro was a year ago, but I was too in love with Laravel and so I ignored it. A week ago I wanted to add a post to my blog, but I got annoyed by the complexity of my own website, and so I said “Fuck it, I’m going to rewrite the whole website, once again.”

Meme: I am once again rewriting my website in a different framework

I don’t know where the idea of using Astro came from, but after a week of using it I can say that it was truly a great idea.

Pros

Cons

I don’t know how to explain it, but it looks like the vscode extension sometimes “dies” or “goes to sleep” (if you will):

Closing thoughts

I still haven’t finished working on this website but I can say that i’m loving building it. Everything seems “natural” and how it should be. And the fact that I’m paying a buck for hosting makes me love it even more. See ya on v5!