目录结构
一个基本的 Jekyll 站点通常是这样的:
.
├── _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 站点的目录结构
从 Jekyll 3.2 版本开始,通过 jekyll new
命令创建的站点使用 基于 gem 格式的主题 来定义站点的外观。最终生成的站点的默认目录结构更加简化:默认情况下,_layouts
、_includes
和 _sass
目录存在于主题的 gem 中。
minima 是当前的默认主题,并且执行 bundle show minima
命令将显示 minima 主题所包含的文件在当前计算机上的存储位置。
每个文件的功能:
文件 / 目录 | 描述 |
---|---|
|
存储的是 配置 信息。其中许多 参数是可以在命令行中指定的,但是 在此文件中进行设置会更容易些,并且你不必记住它们。 |
|
草稿(Drafts)是未发布的文章(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:
|
|
格式化的站点数据应当放在此目录下。Jekyll
将自动加载此目录下的所有数据文件(支持 |
|
这些事可以导入(import)到 |
|
在 Jekyll 转换完所有的文件之后,将在此目录下放置生成的站点(默认情况下)。
最好将此目录添加到
|
|
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 |
其它文件/目录 |
除了上面列出的目录和文件外,其它所有目录和文件(例如
|