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:
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
andPost
files require Front Matter dashes to be considered for processing. Otherwise, they’re simply designated as aStaticFile
.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
- Open a command prompt with Administrator access
- Install Chocolatey:
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
- Close the command prompt as Chocolatey will not be available until you close and reopen.
- Open a command prompt with Administrator access
- Intall Ruby:
choco install ruby -y
- Close and open a new command prompt with Administrator access
- Install Jekyll:
gem install jekyll
Found this guide here.