Skip to content

Instantly share code, notes, and snippets.

@kiraio-moe
Created November 28, 2022 18:44
Show Gist options
  • Save kiraio-moe/fa20e9e4fd95fd865e8f806b148bbc31 to your computer and use it in GitHub Desktop.
Save kiraio-moe/fa20e9e4fd95fd865e8f806b148bbc31 to your computer and use it in GitHub Desktop.
Get the latest Jekyll documentation locally for offline use.

πŸ“˜ Overview

How to get the latest Jekyll documentation for offline use? Well, you may just get it by cloning the repo or through jekyll-docs but the version they provide is obsolete and may not be updated yet.

If you don't have a lot of internet data to clone the repo, you can use this method.

πŸ“– Steps

  1. Go to Jekyll GitHub release page then search Jekyll version you want.

  2. Download the source code under Assets dropdown. Choose either .zip or .tar.gz (It's under 2 MB).

  3. Extract the archive or just copy the docs folder.

  4. Go to the docs folder and create a file named Gemfile (without any extension) then add the following:

    # frozen_string_literal: true
    
    source "https://rubygems.org"
    
    # Resolving TZInfo::DataSourceNotFound Errors:
    #   https://github.com/tzinfo/tzinfo/wiki/Resolving-TZInfo::DataSourceNotFound-Errors
    # gem "tzinfo-data" # General
    # gem "tzinfo-data", platforms: [:mingw, :mswin] # Windows x86 (32-bit)
    # gem "tzinfo-data", platforms: [:mingw, :mswin, :jruby] # JRuby
    
    group :jekyll_plugins do
      gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw] # Windows x64 (64-bit)
      gem "jekyll-avatar"
      gem "jekyll-feed"
      gem "jekyll-mentions"
      gem "jekyll-redirect-from"
      gem "jekyll-seo-tag"
      gem "jekyll-sitemap"
      gem "jemoji"
    end
  5. Save and run in command line to install the necessary gems:

    bundle
  6. Launch the docs by typing:

    bundle exec jekyll s

ℹ️ Tips

For your convenience, you can run the Jekyll documentation on a different port (default: 4000) to view both the documentation and your project at the same time. Open up Jekyll docs _config.yml file then add at the bottom of the file:

port: <your_desired_port_number>

or you can just pass the parameter when launching the docs:

bundle exec jekyll s --port <your_desired_port_number>

πŸ“‘ Afterwords

Thank you for reading! If you find it useful, consider leaving a star 🌟.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment