Front Matter
Table Of Contents
Front matter is used to set page data; it must be at the beginning of the file. Markdown pages use the +++
delimiter whilst for HTML documents a comment is used. The page data must be valid TOML.
Markdown
HTML
<!--
title = "Page Title"
-->
{{title}}
Title & Description
The best practice is to assign a title and description to every page:
A page title is inferred from the file name unless a specific title has been defined; when a page is an index file the name of the parent directory is used instead. Use this feature with directory listings to rapidly sketch your site pages.
Summary
The summary field is intended to be used as an introduction to the page content. It is used primarily when generating feeds but could also be used by convention for an introductory paragraph that is rendered using the markdown helper.
By using the summary
like this you can generate menus with rich text introductions.
Image
Set the image
path for an image preview to use when your page is shared on social sites a good practice is to set a default in the site settings:
[]
= "/assets/img/social.jpg"
Then you can override it for particular pages:
Images must be relative paths; they are automatically made absolute when rendering.
Meta Data
To add custom meta data such as keywords to your pages use the [meta]
table:
[]
= "Create, Pages, Guide"
Renders to:
Open Graph
We automatically create default open graph meta data from the title, description and image. You can customize these values in the [open-graph]
table:
[]
= "Title to use when shared on social websites"
Renders to:
The og:
prefix is not required the open graph partial will insert it and the og:url
property is always created automatically.
If you want to set the og:site_name
for all pages you can add this to your site settings:
[]
= "UWE / Universal Web Editor"
Permalinks
A permalink
variable is available to all pages; to provide a permalink for any page is easy:
Permalink
Set the permalink path so you can share a permanent link that will always redirect to the page location making it safer to rename and move pages whilst keeping visitor's bookmarks intact. To configure a permalink redirect just add the path to the front matter:
The permalink
variable will use the redirect path for the page when permalink
is set otherwise the page URL is used; the value is guaranteed to be an absolute URI once it is passed to a template.