
Setting up this Blog
While any ordinary person could have gone for a more mainstream blogging platform like Wordpress as mentioned in an earlier entry, you’d probably be wondering how I ended up in this kind of a set-up.
Well, I could get started with the story about how I set up all this, of course, but let me begin a little bit earlier. I’ve kept blogs on Wordpress.com, and left them forgotten after I’ve stopped making new entries on them. A few months back, the news about Wordpress(.com) making content they host available for AI training (as made official in this post) made me revisit my old blogs and prevent third-party sharing before taking them all down. The end result of all this is make me wary of using Wordpress.com for my blogs.
Meanwhile, a good friend of mine has been enthusing me about this new thing called Astro, and keeping me up-to-date with his adventures as he tries it out. He also talked to me about Vercel but all this just flew over my head. I told him that maybe I’d understand more if I give it a try.
And now, I’ve got the perfect opportunity to try it all out. So, how did I manage to set this up? Not alone, that’s for certain.
I did try setting it up on my own, but unfortunately, having no experience at all with such technologies, I failed miserably, mistaking a write-up for fairly experienced users as a how-to guide for setting things up and stopping when I encountered a step which asked me to make some changes to my (Astro) configuration file. I thought it prudent to just give it a rest and resume some other time, perhaps after some more reading.
Later on that day, my friend asked me about my progress. I told him about what happened and asked me if I want to start from scratch, to which I said “yes, by all means!”
Before we start, I must make one thing clear. This is not meant as a guide to setting up a themed Astro blog to GitLab and deployment via Vercel. With that out of the way, this is where we finally begin.
-
Set-up Git and Node for my system. This has already been done ages ago for other purposes, but I had to sort out some kinks in my Node configuration that might cause me some trouble before proceeding with the rest.
-
Set-up Astro. In my case, I ran the set-up command for my theme, which looked like this:
npm create astro@latest -- --template kirontoo/astro-theme-cody
-
I then had to upload this to my GitLab account. This gave us a bit of trouble, as some missteps were made. Some of these missteps include:
- forgetting to commit to the (local) repository after setting things up (step 2)
- forgetting to set-up the necessary SSH keys for my Git to connect to my GitLab account (supposedly part of step 1).
After that, it’s as ‘simple’ as entering the following command:
git remote add origin git@gitlab.com:account-name/repository-name.git
It’s only as simple as that given all the set-up done at step 1. Future changes can then be uploaded via a
git commit
command. -
Then, I deployed this GitLab project via Vercel. To do that, I went to Vercel’s site and doing the following
- Add new project
- Adjust any options presented in the next screen. There’s really no need to do this in my case, so I went ahead to the next step.
- Click the deploy button to start deploying.
Of course, it didn’t go perfectly smoothly. I had some problems with the deployment due to some earlier misstep involving pnpm which somehow got involved in my earlier set-up. Fortunately, all I had to do is to delete some files, make another commit to and push the changes to the repo and check the deployment if it succeeded. And fortunately it did.
-
Now, I realized that the project name I gave back at step 3 propagated all the way to the deployment stage, and is now reflected on the subdomain name I have for my blog. That’s no good as I basically thought “this is a blog I made via astro, and so I’ll name it astroblog!” Apparently dozens or so people have thought the same, and that’s just those who deployed it via Vercel! Fortunately, there’s a way to change that, and I did.
-
And then I realized that I left a lot of the theme placeholders in, and had to remove them all, and replace what needs to be replaced. So I did just that and did another commit and this time, Vercel automatically deployed the changes.
And that’s it! That’s how I set-up this blog. I expected it to be a project that’d take me at least a weekend or two, but I managed to complete it all in just one day.