Jekyll: Quick Start

 
This post describes how to start Jekyll on docker.
 

What is Jekyll?

Jekyll is a blog generator. "GitHub Pages are powered by Jekyll, so you can easily deploy your site using GitHub for free" https://jekyllrb.com/
 

init

First, let's set the alias as:

$ alias jk='docker run --rm --volume="$PWD:/srv/jekyll" -it -p 4000:4000 jekyll/jekyll jekyll'

Create the project and change the directory.

$ jk new myblog
$ cd myblog

You will see the files like below:

.
├── 404.html
├── Gemfile
├── _config.yml
├── _posts
│   └── 2021-04-08-welcome-to-jekyll.markdown
├── about.markdown
└── index.markdown

run

Run the following two commands to run the Jekyll server locally:

$ jk build
$ jk serve

then access http://localhost:4000
 


hello world

Files in _post directory is served. Let's copy the welcome page to make a hello-world example.

$ cp _posts/2021-04-08-welcome-to-jekyll.markdown _posts/2021-04-09-hello.markdown
$ vim _posts/2021-04-09-hello.markdown
---
layout: post
title: "Hello"
date: 2021-04-08 06:09:25 -0500
categories: intro
---
World! 

Reload http://localhost:4000 to see the newly created page.



Comments

Popular posts from this blog

Selenide: Quick Start

Minikube Installation for M1 Mac

Three.js Quick Start - Run Spinning-Cube Example