Kind and Type
Path | Kind | Type | layouts/ | layouts/_default/ |
---|---|---|---|---|
. | home | page | index.html | list.html |
blog | section | blog | blog/list.html | list.html |
blog/name.md | page | blog | blog/single.html | single.html |
tags | taxonomy | tags | tags/terms.html | list.html |
tags/term | term | tags | tags/term.html | list.html |
Kind: home
, section
, page
, taxonomy
, term
. Check with
.IsHome
, .isSection
, .IsPage
in a layout file.
Type: The value of type
in the front matter, else the name of the
root section (The first directory in the file path), else page
.
Subsections like blog/topic have the same type as the root section.
Destination
The default is /:section/:slug
and it is available as .Permalink
in layouts.
-
For taxonomies or a term,
:section
is the taxonomy name. -
The value of
:slug
is set fromslug
in the front matter, else fromtitle
.Tip: Before modifying the title of an existing page, set
slug
in the front matter to the current value. Then modify the title, and the permanent link will not change.
Use [permalinks]
in config.toml
to customize the path for pages
in a section. For example, a date-based folder hierarchy for the
blog section:
[permalinks]
blog = "/:section/:year/:month/:title/"
:year
and :month
are taken from the value of date
in front matter.
:slugorfilename
gets the value of slug
, else from filename
.
Can override with slug
or url
in the front matter. url
can
override the section in the destination and takes precedence.