Manual: Pages
Like Grav pages,
Gravitron pages are plain text files in UTF-8 encoding.
They consist of a page head (in YAMLsyntax) with control
information and the actual page content (in Markup syntax). Pages start with ---
on line 1 and the divider between YAML and Markup is also a ---. The basic structure looks like this:
--- Control information in YAML syntax --- Content in Markup syntax
Example page source code
The complete content of a page may look like this — have an eye on it and continue reading below the code:
---
title: "Theme"
slug: "/showcase/theme"
date: '05-01-2006 00:00'
published: true
robots: "index,follow"
visible: true
aliases:
- "/demopage"
- "/showcase/css"
- "/css"
tags:
- Gravitron
- CSS
- Markup
- Twig
- PHP
- HTML
categories:
- Features
- Documentation
- Theme
author:
name: Stefan
email: contact@gravitron.dev
---
# Heading
The page content. Some text with **formatting** and a [link](/home), too.
## Paragraph 2
Some more text ...
First part: Page head
The first part in YAML syntax, after an initial
--- up to the next --- is containing lines with title:,
slug:, date: and published: — This is the page
configuration.
Mandatory items
The minimum set of items required for a page to be displayed (without actual content yet) are:
slug: "/full/url/of/page"
title: "Page title"
published: true
visible: true
A page must
- have a
slug: The full URL to this page (Grav just needs a slug relative to te page parent here) - have a
title: Be sure to enclose it in quotes, no matter if it's one word or more words - be visible:
visiblemust be set to true, else the page will not be displayed - be published:
publishedmust be set to true, else the page will not be displayed
Everything else is optional.
Optional items
Blah blah blah...
Second part: Page content
Everything after the second --- is the pages content in
Markup language. It will be rendered
wherever the corresponding placeholder {{ content }} or {{ content|raw }}
is in your page template(s).