Congratulations! You now have a blog up and running (or on your way)
Let’s take a pause to take a look at Jekyll’s conventions.
Project Structure
- Jekyll outputs into a _site directory
- Simply copied over
- Files without Front Matter
- Directories without “_” underscore prefix
- Read / Processed by Jekyll
- Directories with “_” prefix
- Files with Front Matter
Quiz: Where can you tell Jekyll to ignore specific files?
Hint:* We worked with this file in step 2
_config.yml
File Types
Content and Data
Pages | .html, .md | root | content |
Posts | .html, .md | _posts | built-in content type |
Data | .yml, .csv, .json | _data | Properties, Configuration, Lists |
Collections | .html, .md | custom | Custom content types and data |
Theme and Style
Layouts | .html | _layouts | content containers, structural view |
Includes | .html | _includes | reusable fragments across layouts or pages |
Styles | .sass | _sass | source files for CSS |
Assets | images, video, pdf … | any | Jekyll happily serves any file type |
Variables
- YAML is the standard for declaring most variables.
- There is a large collection of Standard Variables.
Template Variables Have Scopes
page | File’s Front Matter |
site | Everything in _config.yml |
layout | Layout file’s front matter |
include | Include’s front matter OR provided at point of include |
data | _data collection files (yml, json, csv) |
Puzzle: What if you have a property in both a layout AND a page?
They don't conflict. Each variable scope is a separate namespace.
page.blah != layout.blah != site.blah