Content
Frontmatter
Discover how to use frontmatter to add metadata to your markdown files.
All the files are markdown files with a frontmatter at the top of the file. They are all listed on the index page, except the ones
- with the
draft: trueproperty. - with the
listed: falseproperty.
Bloggrify supports multiple Front-matter attributes for pages.
Controlling visibility
Three attributes decide who sees a page, and they answer three different questions. Mixing them up is easy, so it is worth being explicit:
draftdecides whether the page exists. A draft is never built, so its URL returns a 404.listeddecides whether the blog points at it. An unlisted page is built and reachable, it just never shows up in the listings, the feed or the related posts.robotsdecides whether Google indexes it. Independent of the two above.
The last two are deliberately separate, because the useful combinations differ:
| Frontmatter | Use case | In the listings | In Google |
|---|---|---|---|
| (nothing) | a normal post | yes | yes |
listed: false | an about page | no | yes |
robots: false | a post you would rather not rank | yes | no |
listed: false + robots: false | a page you share by link only | no | no |
An about page is exactly why listed: false does not imply noindex: it is not a blog post, so it
has no place in the listings, but you certainly want people to find it.
robots: false is a request, not a lock. It keeps the page out of search results, it does not make
it private: the page is still built and anyone with the URL can read it.It also supports frontmatter to add metadata to your markdown files.
---
pageid: "2"
title: "Use markdown power"
description: "Use markdown at its full potential."
date: "2024-02-09"
tags:
- markdown
cover: "doc/markdown.png"
---
Here is the list of all the frontmatter attributes:
| Key | Default | Type | Description |
|---|---|---|---|
pageid | string | mandatory if you want to use the comment system. It is used to identify the article. | |
title | string | Defines the page title | |
description | string | Defines the page description. Important for SEO | |
date | string | is used to sort the articles. Date in the future will not be displayed. (format: YYYY-MM-DD) | |
cover | string | Image for the blog post, also used as an OpenGraph cover image | |
comments | false | boolean | Disable comments on this page |
listed | true | boolean | false keeps the page out of the listings, the RSS feed and the related posts. The page is still built, reachable and indexed. Example: an about page |
robots | boolean | string | false means noindex/nofollow, a string sets the directive verbatim. See Controlling indexing | |
draft | false | boolean | true means the page is never built: no URL, no sitemap entry, no feed item. It stays fully visible in npm run dev |
hidden | false | boolean | Deprecated, use listed: false. Kept as a synonym of it and reported at build time |
table_of_contents | boolean | true shows the table of contents on this post (if the theme renders one). It can also be enabled for every post site-wide with the table_of_contents option in app.config.ts. Use notoc to hide it on a single post | |
notoc | false | boolean | true hides the table of contents on this post, even when it is enabled site-wide |
tags | array | List of tags related to the article | |
categories | array | List of categories related to the article | |
author | string | The username of one of the authors defined in app.config.ts. It sets the post byline, the RSS <dc:creator> and the schema.org author. Omit it and the post falls back to the author flagged default: true | |
redirect_to_domain | array | Permanent redirect (301) to another domain with the same path. See documentation | |
redirect_to_full_url | array | Permanent redirect (301) to another url. See documentation | |
language | string | The language of the blog post (useless if it's the same as the whole blog) | |
alternates | array | (for multilingual website. See sitemap reference documentation) | |
alternates.hreflang | string | The language of the alternative version of this page | |
alternates.href | string | The url of a page with the same content in another language (to avoid duplicate content and explicit the relation between the two pages) |