coderefinery / manuals

Diverse operation manuals for CodeRefinery workshops and lesson design.
https://coderefinery.github.io/manuals/
Creative Commons Attribution 4.0 International
9 stars 13 forks source link

Document how to build lessons locally with Jekyll #63

Open bast opened 4 years ago

bast commented 4 years ago

https://github.com/bast/til/blob/master/documentation/jekyll-bundler.md

bast commented 4 years ago

The real motivation for this is that I have had situations where "jekyll serve" looked good and then a day later in the lesson presenting in front of people I realized that something rendered slightly differently on GH Pages. This change was made to avoid this.

juholehtonen commented 3 years ago

My temporary notes on this. (If we are going to go Jekyll --> ZOLA this isn't needed.)

GitHub pages locally

Install Ruby etc.

ruby

sudo yum list "*rh-ruby26*"
rpm --import http://<rpm-key.hos.t>/pub/rpm-gpg-keys/RPM-GPG-KEY-CentOS-SIG-SCLo
sudo yum install rh-ruby26 rh-ruby26-ruby-devel

Set Ruby gems to install only present user

vim ~/.config/fish/config.fish:

set -gx GEM_HOME /home/<user>/.gem/ruby/
set -gx PATH /home/<user>/.gem/ruby/bin $PATH

Or for bash: vim ~/.bashrc:

export GEM_HOME="/home/<user>/.gem/ruby/"
export PATH="/home/<user>/.gem/ruby/bin:$PATH"

Install jekyll & bundler (Ruby)

scl enable rh-ruby26 fish
gem install jekyll bundler

View a (CR) GitHub pages locally

Fork & clone

"Fork" -button in GitHub UI

Create minimal gemfile needed to serve pages locally

vim Gemfile content of the file:

source "https://rubygems.org"

gem "github-pages", group: :jekyll_plugins

Install/update dependencies and serve

scl enable rh-ruby26 fish
bundle install / bundle update github-pages
bundle exec jekyll serve
bast commented 3 years ago

Thanks! I don't think we plan to migrate lessons to Zola soon. This was only discussed for the project website so far.