GitHub Pages を用いて Jekyll 静的ウェブサイトを設定・公開するためのクイックリファレンスです。
ディレクトリ構成
.
├── _config.yml # サイト設定
├── _includes/ # 再利用可能なテンプレートスニペット
├── _layouts/ # ベースページレイアウト
├── _posts/ # ブログ記事 (YYYY-MM-DD-title.md)
├── _sass/ # SASS / SCSS スタイルパーシャル
├── assets/ # 画像・ビルド済み CSS・JS
└── index.md # ホームページコンテンツ
設定ファイル (_config.yml)
title: My Documentation
description: Quick reference cheatsheets
baseurl: "/my-repo"
url: "https://username.github.io"
# GitHub Pages 依存プラグイン
plugins:
- jekyll-feed
- jekyll-seo-tag
- jekyll-sitemap
markdown: kramdown
theme: minima
Frontmatter ヘッダ
---
layout: post
title: "Getting Started with Jekyll"
date: 2026-10-25 12:00:00 +0000
categories: [development, tools]
tags: [jekyll, static-site]
---
Liquid テンプレートヘルパー
出力と変数
{{ site.title }}
{{ page.title }}
{{ content }}
条件分岐とループ
{% if page.comments %}
{% include comments.html %}
{% endif %}
<ul>
{% for post in site.posts limit:5 %}
<li><a href="{{ post.url | relative_url }}">{{ post.title }}</a></li>
{% endfor %}
</ul>
ローカル検証
# 依存関係のインストール
bundle install
# ライブリロード付きローカル開発サーバーの起動
bundle exec jekyll serve --livereload