Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Page frontmatter #7

Open
alterae opened this issue Oct 15, 2022 · 0 comments
Open

Page frontmatter #7

alterae opened this issue Oct 15, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@alterae
Copy link
Owner

alterae commented Oct 15, 2022

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).

@alterae alterae added the enhancement New feature or request label Oct 15, 2022
@alterae alterae mentioned this issue Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant