jekyll

Getting started with jekyll

Remarks#

Jekyll is a simple, blog-aware, static site generator. It takes a template directory containing raw text files in various formats, runs it through a converter (like Markdown) and its Liquid renderer, and spits out a complete, ready-to-publish static website suitable for serving with your favorite web server. Jekyll is also the engine behind GitHub Pages, which means you can use Jekyll to host your project’s page, blog, or website from GitHub’s servers for free.

Jekyll’s website is at https://jekyllrb.com/, and documentation can be found at https://jekyllrb.com/docs/home/.


Latest Release:

Gem Version

Installation or Setup

Quickstart for Jekyll

 $ gem install jekyll
 $ jekyll new my-awesome-site
 $ cd my-awesome-site
~/my-awesome-site $ jekyll serve

Now browse to https://localhost:4000


Quickstart for Jekyll with Bundler

 $ gem install jekyll bundler
 $ jekyll new my-awesome-site
 $ cd my-awesome-site
~/my-awesome-site $ bundle exec jekyll serve

Now browse to https://localhost:4000

Create Jekyll Post And Pages

Create new Jekyll Post

To create a new Jekyll Post, create a new file on _posts directory with the format

YYYY-MM-DD-title.MARKUP

Replace MARKUP with the file extension for the language you want to use. This is usually Markdown(.md or .markdown) or HTML(.html).

_posts/2017-01-01-hello-jekyll.md

Create new Jekyll Page

To create a new Jekyll Page, create a new file on any folder or directory not excluded by Jekyll in your project directory.

about.html
contact/company_info.md

NOTE: Both Page and Post files require Front Matter dashes to be considered for processing. Otherwise, they’re simply designated as a StaticFile.

Front Matter dashes should be at the very beginning, before your content, and simply look like this:

---
---

< your content >

Basic Usage

The Jekyll gem makes a jekyll executable available to you in your Terminal window. You can use this command in a number of ways:

$ jekyll build
# => The current folder will be generated into ./_site

$ jekyll build --destination <destination>
# => The current folder will be generated into <destination>

$ jekyll build --source <source> --destination <destination>
# => The <source> folder will be generated into <destination>

$ jekyll build --watch
# => The current folder will be generated into ./_site,
#    watched for changes, and regenerated automatically.

Jekyll also comes with a built-in development server that will allow you to preview what the generated site will look like in your browser locally.

$ jekyll serve
# => A development server will run at https://localhost:4000/
# Auto-regeneration: enabled. Use `--no-watch` to disable.

Install Jekyll on Linux Mint 18

Install jekyll on Linux Mint 18 with the following steps:

sudo apt install ruby
sudo apt install build-essential 
sudo apt install ruby-dev
sudo gem install jekyll

Install Jekyll on Windows

  1. Open a command prompt with Administrator access
  2. Install Chocolatey: @powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
  3. Close the command prompt as Chocolatey will not be available until you close and reopen.
  4. Open a command prompt with Administrator access
  5. Intall Ruby: choco install ruby -y
  6. Close and open a new command prompt with Administrator access
  7. Install Jekyll: gem install jekyll

Found this guide here.


This modified text is an extract of the original Stack Overflow Documentation created by the contributors and released under CC BY-SA 3.0 This website is not affiliated with Stack Overflow