Skip to content

Latest commit

 

History

History
50 lines (35 loc) · 1.99 KB

README-new.md

File metadata and controls

50 lines (35 loc) · 1.99 KB

Running your github pages site locally with jekyll

Sources:

  • AWESOME (this finally helped): Click here
  • Docs - Testing your GitHub Pages site locally with Jekyll: Click here
    • Docs - Creating a GitHub Pages site with Jekyll: Click here
  • Jekyll docs: Click here
    • Above docs suggested the additional install of webrick by running bundle add webrick which is necessary.
  • Exclude folders from jekyll compilation, for e.g., node_modules - Click here

Steps:

Versions (tested on archlinux):

$ ruby --version
# OUTPUT:
# ruby 3.0.6p216 (2023-03-30 revision 23a532679b) [x86_64-linux]

$ bundler --version
# OUTPUT:
# Bundler version 2.5.6

Follow from this - Guide to run Gihtub pages locally with Jekyll

  1. I had to do sudo bundle install using sudo otherwise I was getting permission error.

  2. Make Gemfile contents to look like that:

source "https://rubygems.org"
# Note to Sahil: 231 version specified below comes from this link - https://pages.github.com/versions/
gem "github-pages", "~> 231", group: :jekyll_plugins
gem "webrick", "~> 1.8"
  1. Add any node_modules directory to _config.yml if you have any, otherwise ignore this step:
include: [".well-known"]
exclude: ["thoughts-principles-react/node_modules/*"]
  1. run the serve command with --livereload, when using below command with sudo the devlopment server seems to work (otherwise I get permission error):

sudo bundle exec jekyll serve --livereload --incremental

Thanks