一个基本的 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-cache
│ └── Jekyll
│ └── Cache
│ └── [...]
├── .jekyll-metadata
└── index.html # can also be an 'index.md' with valid front matter
基于 Gem 主题的 Jekyll 站点目录结构
从 3.2 版本开始,基于 Gem 主题 启动一个新的 Jekyll 项目时只需 jekyll new
即可生成一个比较规范的站点结构。这就导致了一个更轻量的目录结构: _layouts
、_includes
和 _sass
默认都保存在 Gem 主题内。
minima 是当前默认主题,bundle info minima
会显示 minima 主题文件在您的计算机的存储位置。
目录结构内文件/文件夹概览:
文件 / 文件夹 | 简介 |
---|---|
| Stores configuration data. Many of these options can be specified from the command line executable but it’s easier to specify them here so you don’t have to remember them. |
| Drafts are unpublished posts. The format of these files is without a date: |
| 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: |
| Well-formatted site data should be placed here. The Jekyll engine will autoload all data files (using either the |
| These are sass partials that can be imported into your |
| This is where the generated site will be placed (by default) once Jekyll is done transforming it. It’s probably a good idea to add this to your |
| Keeps a copy of the generated pages and markup (e.g.: markdown) for faster serving. Created when using e.g.: |
| 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. Only created when using incremental regeneration (e.g.: with |
| Provided that the file has a front matter section, it will be transformed by Jekyll. The same will happen for any |
Other Files/Folders | Except for the special cases listed above, every other directory and file—such as |
source
文件夹中每个以字符 .
、_
、#
或~
开始的文件或者文件夹都不会包含在 目标(destination)
文件夹。有些路径必须通过配置文件的 include
命令明确定义以确保它们被复制:
include:
- _pages
- .htaccess