I have decided to finally set up a mini blog type site on my under utilised GitHub. The main intention is to have a single place to put all the random stuff I find when browsing the internet, twitter and linkedin, in a format I can then share as and when I think it could be useful to the wider world.
GitHub Pages
I follow the instructions to setup a new repository franck-chester.github.io
on my personal GitHub https://github.com/franck-chester.
My default branch, where I will create content and configure Jekyll, is main
.
I create an additional gh-pages
branch where I will publish the built up site.
I then configure GitHub pages to source content from gh-pages
Finally, I clone this blank repository to my ubuntu environment on WSL2.
Jekyll
Jekyll is a static site generator, and comes recommended when setting up GitHub Pages.
Setting it up in my new repository was no problem, just follow the instructions.
It isn’t officially supported on Windows, but not an issue here as I have just setup Ubuntu on WSL2. Plus running it locally on Ubuntu keeps it all much closer to the GitHub action environment that I intend to use for the day to day site generation.
Look & Feel - So Simple
I don’t really want to spend too much time styling this, so will simply use one of the many available free Jekyll themes, in this case So Simple looks good enough - as per this example site.
Configuring So-Simple
From the README.ME file:
Add this line to your Jekyll site’s Gemfile (or create one):
gem "jekyll-theme-so-simple"
Add this line to your Jekyll site’s _config.yml file:
theme: jekyll-theme-so-simple
Then run Bundler to install the theme gem and dependencies:
bundle install
Create some default content
In the root of my site, I create the following pages, using markdown, and the corresponding So-Simple layouts in the front-matter :
- index.md
- posts.md
- search.md
- tags.md
Configuring GitHub
We can’t use GitHub Pages’ built in Jekyll functionality, as it is many versions behind and limits the gems we can use. Instead, we will use helaili/jekyll-action to publish our GitHub pages via a GitHub action.
Again, we can simply use the documentation, making sure to target the gh-pages
branch.
We can push our main
branch to GitHub, which triggers the GitHub action, which results in a nicely styled blog like site - result.
Development cycle
The easiest IMO is to launch vs code from within WSL2 code .
and use it to both edit the content and launch a local Jekyll instance with
bundle exec jekyll serve --drafts --future
I can test the pages at http://127.0.0.1:4000 before I commit to GitHub.
Also, use this when adding plugins :
gem update