Blog

10 Feb 2021

GH Pages first time with Gatsby

So yesterday I finally set up my Gatsby blog and deployed it to github pages. At first glance, everything looked perfect. The page was loading, the url was correct. Little did I know that it was just the beginning.

First issue I came across was when I tried to change my Twitter link to my main website link. Okay, in development mode, putting in the site name worked PERFECTLY. The moment I deployed that to github, what happened was literally the site was added to the end of my blog url instead. After 10 minutes scrambling through google and react documentation, the issue was solved.

Once I push that version of my site up to gh pages, the second issue emerged. Apparently, every single time I deploy my site using the script, my custom domain got reset. After 5 dumb minutes sitting in front of my computer, I realised that I haven’t added the CNAME file to this repository. So I did that. Deployed it again, the issue seemed to be gone as I could refresh the page without getting an error.

Ten minutes later however, I tried and boom, my custom domain was gone again. So apparently it’s not solved at all, it just seemed to be working because the page wasn’t update yet when I tested. So here I am, digging through all the configs trying to find what went wrong.

Eventually I found this thing and FINALLY, it worked. So yup, half a day just to solve this stupid issue.

Guess it’s time to go for a small afternoon walk and a cup of tea, and hopefully blazing through some basic ReactJS guide tonight so I don’t get stuck with stupid issues again.

Thanks for reading, cheers mate, Huskiez