mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-28 21:21:40 -05:00
5fd1e74903
``` git subtree add --prefix=docs/ https://github.com/gohugoio/hugoDocs.git master --squash ``` Closes #11925
902 B
902 B
title | description | categories | keywords | action | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Layout | Returns the layout for the given page as defined in front matter. |
|
Specify the layout
field in front matter to target a particular template. See details.
{{< code-toggle file=content/contact.md >}} title = 'Contact' layout = 'contact' {{< /code-toggle >}}
Hugo will render the page using contact.html.
layouts/
└── _default/
├── baseof.html
├── contact.html
├── home.html
├── list.html
└── single.html
Although rarely used within a template, you can access the value with:
{{ .Layout }}
The Layout
method returns an empty string if the layout
field in front matter is not defined.