Skip to content
experimenthouse edited this page Mar 6, 2019 · 1 revision

Pages are sections of the website that can be used to display information or group other content.

Making a page

Pages are made by creating a Markdown file somewhere in the website source directory or in a subdirectory.

  • website/page-title.markdown
  • website/pages/page-title.markdown
  • website/group-of-pages/page-title.markdown
  • website/page/subpages/page-title.markdown

The path of the file (its location relative to the website source directory) will determine its URL on the website unless a permalink is specified in the file itself. Without specifying a permalink, the above examples would be accessible at:

  • rzzt.io/page-title.html
  • rzzt.io/pages/page-title.html
  • rzzt.io/group-of-pages/page-title.html
  • rzzt.io/pages/subpages/page-title.html

Page frontmatter

Every page requires frontmatter at the start of the file to determine its layout and title, as well as other optional parameters. This is in YAML format and will typically look like this:

---
layout: page
title: "Page Title"
---

A page's YAML frontmatter can also be used to specify its URL, which will override its location in the source files:

---
layout: page
title: "Page Title"
permalink: "/page-url/"
---

Imagine that the page is located in the website source directory at website/pages/subpages/page.md:

  • In the first example the output would be accessible at rzzt.io/pages/subpages/page.html.
  • In the second example the output would be accessible at rzzt.io/page-url/ and rzzt.io/page-url/index.html.

Adding a page to the menu

The RZZT website has a menu that appears at the top of each page by default. This menu supports three nested levels, using the YAML frontmatter to determine whether a page is included, where, and it what order:

---
layout: page
title: "A"
parent: "Home"
order: 2
subpages: "yes"
---
  • Using parent: "Home" tells Jekyll that this page belongs at the top level of the menu.
  • Using subpages: "yes" tells Jekyll to look for pages whose parent is the title of this page (that is, any page with parent: "A").
  • Using order: 2 tells Jekyll that this page should be placed after any page with an order value less than 2, but before any page with an order value greater than 2.

The following is an example of a page nested under the one in the example above:

---
layout: page
title: "B"
parent: "A"
order: 1
subpages: "yes"
---

Another page could be nested under this one (the third and final level):

---
layout: page
title: "C"
parent: "B"
order: 3
---

Note that if a page does not have subpages, subpages: "yes" can simply be omitted.

Page content

Page content begins after the YAML frontmatter and is written using Markdown syntax:

---
layout: page
title: "Page Title"
---

**Cum sociis natoque** penatibus et magnis dis parturient montes,
[nascetur ridiculus mus](https://rzzt.io/another-page/). Vestibulum
_id ligula porta_ felis euismod semper.

Clone this wiki locally