LoginSignup
3
3

More than 5 years have passed since last update.

Jekyllのページファイルを_pagesなどのフォルダで整理する方法

Posted at

Jekyllのデフォルト設定では_postsフォルダに入れたものは投稿として生成してくれるが、ページファイルはsource直下に置かなくてはいけない。これを整理したい。

これを

_config.yml
_posts
index.html

こうしたい

_config.yml
_pages
└ index.html
_posts

手順は2つです。

1. _config.yml_pagesを読み込む指定を記述

_config.yml

# 設定いろいろ...
include: ['_pages'] # この行を追加

2. 対象のページ(ここではindex.html)にpermalinkをセット

index.html
---
layout: default
title: HOME
permalink: / # permalinkにルートを指定
---

参考リンク:
https://github.com/jekyll/jekyll/issues/920

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3