目錄結(jié)構(gòu)
一個基本的 Jekyll 站點(diǎn)通常是這樣的:
.
├── _config.yml
├── _data
| └── members.yml
├── _drafts
| ├── begin-with-the-crazy-ideas.md
| └── on-simplicity-in-technology.md
├── _includes
| ├── footer.html
| └── header.html
├── _layouts
| ├── default.html
| └── post.html
├── _posts
| ├── 2007-10-29-why-every-programmer-should-play-nethack.md
| └── 2009-04-26-barcamp-boston-4-roundup.md
├── _sass
| ├── _base.scss
| └── _layout.scss
├── _site
├── .jekyll-metadata
└── index.html # 也可以是帶 front matter 的 'index.md' 文件
使用基于 gem 格式的主題的 Jekyll 站點(diǎn)的目錄結(jié)構(gòu)
從 Jekyll 3.2 版本開始,通過 jekyll new 命令創(chuàng)建的站點(diǎn)使用 基于 gem 格式的主題 來定義站點(diǎn)的外觀。最終生成的站點(diǎn)的默認(rèn)目錄結(jié)構(gòu)更加簡化:默認(rèn)情況下,_layouts、_includes 和 _sass 目錄存在于主題的 gem 中。
minima 是當(dāng)前的默認(rèn)主題,并且執(zhí)行 bundle show minima 命令將顯示 minima 主題所包含的文件在當(dāng)前計算機(jī)上的存儲位置。
每個文件的功能:
| 文件 / 目錄 | 描述 |
|---|---|
|
|
存儲的是 配置 信息。其中許多 參數(shù)是可以在命令行中指定的,但是 在此文件中進(jìn)行設(shè)置會更容易些,并且你不必記住它們。 |
|
|
草稿(Drafts)是未發(fā)布的文章(posts)。這些文章的文件名中沒有包含
日期: |
|
|
These are the partials that can be mixed and matched by your layouts
and posts to facilitate reuse. The liquid tag
|
|
|
這里存放的是These are the templates that wrap posts. Layouts are chosen on a
post-by-post basis in the
front matter,
which is described in the next section. The liquid tag
|
|
|
Your dynamic content, so to speak. The naming convention of these
files is important, and must follow the format:
|
|
|
格式化的站點(diǎn)數(shù)據(jù)應(yīng)當(dāng)放在此目錄下。Jekyll
將自動加載此目錄下的所有數(shù)據(jù)文件(支持 |
|
|
這些事可以導(dǎo)入(import)到 |
|
|
在 Jekyll 轉(zhuǎn)換完所有的文件之后,將在此目錄下放置生成的站點(diǎn)(默認(rèn)情況下)。
最好將此目錄添加到
|
|
|
This helps Jekyll keep track of which files have not been modified
since the site was last built, and which files will need to be
regenerated on the next build. This file will not be included in the
generated site. It’s probably a good idea to add this to your
|
|
|
Provided that the file has a front
matter section, it will be transformed by Jekyll. The same will
happen for any |
|
其它文件/目錄 |
除了上面列出的目錄和文件外,其它所有目錄和文件(例如
|