[til] setting up jekyll site deployed to github pages
This is how I setup a static Jekyll site hosted with github pages. The code is hosted at https://github.com/galtay/blog and the site is hosted at https://galtay.github.io/blog.
Setup Ruby
Install a Ruby version manager. I used rbenv. I was working on Ubuntu so I used apt,
sudo apt install rbenv
Add the following init command to ~/.zshrc
and source it.
eval "$(rbenv init -)"
Configure a specific version of Ruby.
rbenv install 3.1.2
rbenv local 3.1.2
rbenv rehash
Setup Minimal Mistakes Theme
The minimal-mistakes theme by Michael Rose is great!
I began with the starter repo and simply updated the links in _config.yml
and started writing posts.
Posts can be written in markdown and the flavor of markdown used is kramdown.
Run Locally
Install bundler
gem install bundler
Install project dependencies
bundle install
Run the site locally
bundle exec jekyll serve
Deploy from git branch
I setup my repo to deploy from the main
branch.
I did this by navigating to [Settings] -> [Pages] -> [Build and deployment] and choosing Deploy from a branch
with the main
branch chosen.
When I’m happy with the local changes, I push to the main
branch and the site is automatically deployed.