jeberle.github.io

Instructions for getting a Jekyll project bootstrapped, starting from a clean machine.

See also: Creating your site on GitHub.

Install Specific Ruby Version (3.2)

brew install ruby@3.2

Update PATH Variable

Add /usr/local/opt/ruby@3.2/bin and /usr/local/lib/ruby/gems/3.2.0/bin before /usr/bin

rbin=/usr/local/opt/ruby@3.2/bin
gbin=/usr/local/lib/ruby/gems/3.2.0/bin
PATH=/usr/local/bin:$rbin:$gbin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Apple/usr/bin
. ~/.bashrc
type gem ruby

Install Bundler & Jekyll

gem install bundler jekyll

Create Jekyll Project

cd some-dir
jekyll new --skip-bundle --force .

Edit Gemfile

These changes are for GitHub Pages. The current version of github-pages is at Ruby Gems.

#gem "jekyll", "~> 4.3.2"
gem "github-pages", "~> 231", group: :jekyll_plugins

Download Gems

bundle install

Edit _config.yml

Here, making an explicit reference to the unspecified theme “primer” used by GitHub Pages. Also setting title.

title: "Some Website" # defaults to project dir name, seen in <title> and page header
remote_theme: pages-themes/primer@v0.6.0
plugins:
  - jekyll-feed

Install & Run Webserver

bundle add webrick
rlib=/usr/local/opt/ruby@3.2/lib
DYLD_LIBRARY_PATH=$rlib bundle exec jekyll serve --livereload

Resolve GitHub Metadata Access

Make sure the following vars in _config.yml are set:

# set these to deactivate metadata lookup
github:      []
title:       "jeberle.github.io"
description: ""
url:         "" # the base hostname & protocol for your site, e.g. http://example.com
baseurl:     "" # the subpath of your site, e.g. /blog

For actual lookup (and to resolve the GitHub Auth warning), create a GitHub token here https://github.com/settings/tokens. The only required auth is “access to public repos”. Then:

export JEKYLL_GITHUB_TOKEN='<token-string>'

The plugin is part of github-pages and so is baked in. https://jekyll.github.io/github-metadata/