Setting up eddsansome.com
Jan 24, 22So here we are then - this is eddsansome.com, my superawesomemegablog. There were a couple of considerations about the best way to get some content online, so here is my thought process, and what I ultimately ended up choosing to create my blog.
Firstly, I will say that this will probably be the only site that will not use Ruby on Rails, as the framework would be overkill for serving static pages. Plus the hosting could be relatively expensive (i.e not free) if I want 100% availability, for all of the 3 people that will probably read this ^^
I also resisted the primal urge to code up a static site generator myself using rack
and a sprinkle of Ruby. Whilst I am not against this idea, in the past when I have started a blog project, I have a lot of fun coding up the framework for the blog and creation of static pages, that by the time I need to actually write some content I have completely run out of steam.
I considered hugo as I do enjoy writing Go, however as a junior Ruby on Rails engineer I really want to focus on growing professionally, so for the time being my attention is on going deeper with Ruby and Rails over the coming months.
With all that said then, I finally opted to choose Jekyll as the SSG for eddsansome.com. It was super easy to setup locally, although there were a couple of issues that I had to resolve:
eventmachine does not compile with ruby 3.0.0preview1 on macOS
This error prevented me from even installing the jekyll CLI. It was resolved by running the below command (M1 Mac specific)
gem install eventmachine -- --with-openssl-dir=/opt/homebrew/opt/openssl@1.1
- Then re-running the
gem install jekyll
command
Jekyll serve fails on Ruby 3.0
This error prevented me from serving the jekyll files locally. It was resolved by running the below command (inside of the jekyll app’s dir)
bundle add webrick
- We could then run the jekyll serve command to preview the site locally
Config mishap
Once the site was pushed up on the gh-pages
branch, navigating to the root domain appeared to show the content, but without any CSS. Turns out you need to set the correct domain within the _config.yml
file at the root of the project.
DNS issues
sigh its always DNS :D
Rather than waffle about what steps I took to setup DNS and https on google domains, here is just the pertinent information so I can copy and paste the config should I need to setup another blog site (lol)
A Record
These are for HTTPS and reference github.com
’s IP adresses.
TXT
This is for something, but I forgot why I need it - it is included in the GH pages docs.
CNAME
Point www.eddsansome.com to my hosted github page.
Host | Type | TTL | Data |
---|---|---|---|
eddsansome.com | A | 1 hour | 185.199.108.153 |
185.199.109.153 | |||
185.199.110.153 | |||
185.199.111.153 | |||
[snippedinfo].eddsansome.com | TXT | 1 hour | “secret” |
www.eddsansome.com | CNAME | 1 hour | [github-username].github.io |
Once all of the above was setup, I clicked to confirm the DNS settings and also enforce HTTPS
- noice!
So there we go - that is how I setup this humble blog of mine. I will make a few tweaks, but overall I am happy with the site and the deployment process..
- create a markdown file
- commit to version control
- push to
gh-pages
branch remotely.
Right.. On to the next app on the list!