Layout
Returns the layout of the given page as defined in front matter.
- Syntax
- PAGE.Layout
- Returns
- string
Usage
The Layout method on a Page object returns the layout of the given page as defined by the layout field in front matter. If the layout field is not defined, the method returns an empty string.
Set the layout field in front matter to target a specific template. This method is rarely used within a template.
Examples
Given this front matter:
---
layout: contact
title: Contact
---+++
layout = 'contact'
title = 'Contact'
+++{
"layout": "contact",
"title": "Contact"
}
{{ .Layout }} → contactLast updated:
November 8, 2026
:
content: Remove categories from front matter (1cc1dd83a)
Improve this page