Skip to content

Page frontmatter #7

Description

@alterae

I don't really want to do this but I do not see another way to allow users to define arbitrary per-page metadata, which we need in order to properly handle things like titles and descriptions in layouts.

We could probably do TOML front matter like so:

+++
title = "Page Title"
description = "A brief one-sentence description of the page"
+++

Page contents...

And then make it accessible to templates like so:

<head>
  <title>{{ page.data.title }}</title>
  <meta name="description" content="{{ page.data.description }}" />
</head>

This will require #3, and will also interact with #4.

We might also want to support YAML front matter but I really do not like that idea.

Alternatively, if we were using a templating engine that wasn't Tera, we could do something using the templating language (a {% export title "Page Title" %} type deal).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions