Archives configuration is done in the site's _config.yml
file, under the jekyll-archives
key.
jekyll-archives:
posts: # the collection name. Can be accessed with :collection
enabled: []
layout: archive
permalinks:
year: '/:collection/:year/'
month: '/:collection/:year/:month/'
day: '/:collection/:year/:month/:day/'
tags: '/:collection/:type/:name/'
Key | Value type | Values |
---|---|---|
enabled |
Boolean, String, or Array | true , 'all' , or an array of any combination of year , month , day , or other array attribute like tags or categories |
This option sets which types of archives will be created. Must be set to an array of enabled archive types, or the string 'all' (to enable all archives).
enabled: true
enabled: all
enabled:
- categories
enabled:
- year
- month
- tags
Key | Value type | Values |
---|---|---|
layout |
String | The layout name of the default archive layout |
Sets the default layout to use if no type-specific layout (see Type-specific layouts below) for an archive is specified.
layout: archive # _layouts/archive.html
layout: custom-archive-layout # _layouts/custom-archive-layout.html
Key | Value type | Values |
---|---|---|
layouts |
Map, String → String | A layout or a map of layout type (year , month , day , or other array attribute like tags or categories ) to its archive name. |
Maps archive types to the layout they will be rendered in. Not all types need to be specified; those without a specific layout will fall back to the default layout.
layouts:
year: year-archive
month: month-archive
day: day-archive
categories: category-archive
tags: tag-archive
Key | Value type | Values |
---|---|---|
permalinks |
Map, String → String | A map of layout type (year , month , day , or other array attribute like tags or categories ) to its permalink format. |
Maps archive types to the permalink format used for archive pages. The permalink style is the same as regular Jekyll posts and pages, but with different variables.
These variables are:
:year
for year archives:year
and:month
for month archives:year
,:month
, and:day
for day archives:name
for any other attribute archives (e.g. category or tag), contains the value of the attribute (e.g.sample-posts
):type
contains the name of the attribute, singularized (e.g.category
). The singularization of the attribute name is handled by the singularize method from the ActiveSupport gem.:collection
the name of the collection (e.g.posts
)
Note: trailing slashes are required to create the archive as an index.html
file of a directory.
permalinks:
year: '/:collection/year/:year/'
month: '/:collection/:type/:year-:month/'
tags: '/:collection/:type/:name/'
Archives of tags and categories are by default generated by slugifying the tag or category name.
You can configure the result of this process by setting the slug_mode
key to any of the
modes expected by Jekyll
slug_mode: latin