Skip to content

deadlyfingers/blog

Repository files navigation

Developer blog using GitHub Pages with Jekyll

Prerequisites

Requirements

Requires installation of gulp-cli v4 and gulp-gh-pages for deployment.

NB: You will need to remove gulp v3 npm rm -g gulp before installing v4.

npm install -g gulp-cli
npm install --only=dev

Setup

Install dependencies

npm install --only=prod

Copy required dependencies from node_modules into _dev build dir

gulp copy:dev

Install Ruby Gems

gem install bundler
gem install github-pages
gem install jekyll
gem install tzinfo-data

Install Ruby Gems required for Windows

gem install wdm

Install bundle

bundle install

Development

Build

npm run build:dev or bundle exec jekyll build -d ./_dev --config _config.yml,_config_dev.yml --incremental --watch

Serve

npm run serve:dev or bundle exec jekyll serve -d ./_dev --config _config.yml,_config_dev.yml --livereload

If you get an error on Windows: "Unable to load the EventMachine C extension" then try gem uninstall eventmachine followed by gem install eventmachine --platform ruby

Or serve using BrowserSync to test on external devices:

browser-sync start --server '_dev' --files '_dev/**/*' --extensions 'html' --port 3000 --reload-debounce 200 --no-ui --no-open

NB: Include --no-online if there's no internet connection or device is in flight mode!

GitHub Pages

Build

npm run build or bundle exec jekyll build

Soft Deploy

npm run softdeploy

Local server

npx http-server ./_site

Deploy

Deploys build to 'gh-pages' branch

npm run deploy

NB: This publishes all changes to the the live site!