These are my notes about setting up your GitHub Pages site locally…
See also: GitHub’s Setting up your GitHub Pages site locally with Jekyll guide.
lxc-create -t download -n gh-pages -- -d ubuntu -r xenial -a amd64
lxc-start -n gh-pages
lxc-attach -n gh-pages -- passwd ubuntu
lxc-attach -n gh-pages -- login ubuntu
sudo apt update
sudo apt install git curl gcc libffi-dev ruby-ffi build-essential patch zlib1g-dev liblzma-dev ruby ruby-dev
sudo gem install bundler
gem install ffi, consult your fav search engine (example)gem install nokogiri, goto nokogiri.org
You must bundle Filter gem dependencies, follow the link that message provides
mkdir -p -m 700 ~/repos && cd ~/repos
git config --global user.name solvaholic
git config --global user.email solvaholic@users.noreply.github.com
git clone https://github.com/solvaholic/solvaholic.github.io.git
cd solvaholic.github.io/
github-pages and :jekyll_plugins
cat > Gemfile <<EOM
source 'https://rubygems.org'
gem 'github-pages', group: :jekyll_plugins
EOM
bundle install --path vendor/bundle
For example:
git checkout -b me/write-a-post
## Write a post, for example _posts/2017-11-12-gh-pages-local.md
## Make sure it looks like you want
git add _posts/2017-11-12-gh-pages-local.md
git commit -m "Adds a new post"
git checkout master
git pull
git merge me/write-a-post
git push
Create a branch to work in and use your favorite text editor to create _posts/2017-11-12-gh-pages-local.md:
---
layout: post
title: Set up your GitHub Pages site locally
date: 2017-11-12 00:00:01
---
This is a post about setting up your GitHub Pages site locally!
In the root directory of your repository, use jekyll serve to view your GitHub pages site in your browser:
bundle exec jekyll serve
<ctrl-c> to stop your local Jekyll serverexit to exit your containerStop and destroy your container:
lxc-stop -n gh-pages
lxc-destroy -n gh-pages