Bustle C. Just Keep Learning

Build A Blog With Jekyll And GitHub Pages

What is Jekyll

簡單的說, Jekyll 是一個靜態網站的生成器, 很適合用來建立個人部落格或簡單商業網站, 而 Github Pages 也支援 Jekyll Theme, 即可以將你的網站部署到 Github 上進行託管, 如此一來你就可以專注在前端的維護及撰寫文章.

Jekyll 提供強大和靈活性的功能, 可以幫助我們簡單又快速的建立一個網站, 且文章是採用 Markdwon 標準化語法, 通過簡單的標記語法,它可以使普通文本內容具有一定的格式. Find out more by visiting the project on GitHub.

Jekyll is a simple, blog-aware, static site generator perfect for personal, project, or organization sites. Think of it like a file-based CMS, without all the complexity. Jekyll takes your content, renders Markdown and Liquid templates, and spits out a complete, static website ready to be served by Apache, Nginx or another web server. Jekyll is the engine behind GitHub Pages, which you can use to host sites right from your GitHub repositories.

–MORE–

Quick Start

Step 1. Install Ruby and Bundler

To use Jekyll, we need Ruby. First, Go to Ruby and download the installer for Ruby v3.2.2 that matches your system’s architecture (x86 / x64).

Then, run the command to install Bundler

$ gem install bundler

Step 2. Fork Jekyll to your User Repository

Local Development

Step 1. Clone down your fork

$ git clone http://username.github.io/websitename yourLocalDirectory

Step 2. Create Gemfile

source 'https://rubygems.org'
gem 'github-pages', group: :jekyll_plugins

Step 3. Start Server

$ cd directory
$ bundle install
$ bundle exec jekyll serve

Then, View your website at http://127.0.0.1:4000/

_config.ymlThe configuration settings for our site
Gemfile A list of Gem dependencies
Gemfile.lock A list of Gems AKA packages for your project
_postsDirectory for blog posts
_siteDirectory where files are written
404.htmlError page
about.mdAbout page
index.mdHome page

Reference

  • https://docs.github.com/zh/pages/setting-up-a-github-pages-site-with-jekyll
  • https://docs.github.com/zh/pages/setting-up-a-github-pages-site-with-jekyll/about-github-pages-and-jekyll