Understanding GitHub Pages and Jekyll
GitHub Pages allows you to host websites directly from your GitHub repository. Simple as pie?
![]()
Jekyll themes?
Let’s explore the supported themes.
Some favorites:
-
hackertheme seems good for obvious reasons
-
midnightis a contender -
minimawith some nice themes -
caymanseems smooth
Configuration
We just update the theme in the _config.yml file.
theme: jekyll-theme-chirpy
plugins
We can update the _config.yml to include new features using plugins. We can then support GitHub emojis with jemoji. ![]()
Layouts
Default layout (ex. layout: post) can be found here. You can create your own like this.
File structure (added 1/9)
Reading the docs, I apparently need to change the file structure of my posts:
├── _posts
│ ├── 2007-10-29-why-every-programmer-should-play-nethack.md
│ └── 2009-04-26-barcamp-boston-4-roundup.md
Running Jekyll locally
Then we use the GitHub pages guide to get Jekyll up and running:
- Ruby is already installed in my WSL setup.
- I had an old version of ruby so used ruby-install to install a newer version.
- Ruby path
/home/vthoren_u/.rubies/ruby-3.3.4/bin/rubyecho '# Install Ruby Gems to ~/gems' >> ~/.zshrc echo 'export GEM_HOME="$HOME/gems"' >> ~/.zshrc echo 'export PATH="$HOME/gems/bin:$PATH"' >> ~/.zshrc alias gem="/home/vthoren_u/.rubies/ruby-3.3.4/bin/gem" source ~/.zshrc
- Installing bundle and jekyll
gem install jekyll bundler - Fixing the Gemfile with the version of github-pages
- Install dependencies
bundle install - Start jekyll
bundle exec jekyll serve - Test! http://127.0.0.1:4000/
Continue to develop the site
The post from aleksandrhovhannisyan.com is really good at getting started!
tags: jekyll - github pages