TechniqueMarkdown

This site's Front Matter

2020-11-06Chris Tham

What metadata am I currently using to describe blog posts on this site?

hero

The term Front Matter was originally coined to describe a fixed block (in YAML) prepended in front of a Markdown document.

The Front Matter block contains a number of variables which can be used as metadata to describe the post. The metadata is extracted when processing the Markdown file.

I am currently using the following front matter variables to describe my blog posts. Here is a sample template:

---
date: '2020-01-01'
type: Article
draft: true
title: Template Post
description: This is an example MDX file
author: Chris Tham
featured_image: /drawings/knowledge.svg
tags:
  - template
categories:
  - Template
---

You may notice I am not currently doing anything with the type or tags variables, but I may in the future.

The variables are strongly influenced by the Hugo Front Matter definitions

date : the datetime assigned to this page

type : the type of the content

draft : if true, the content will not be rendered

title : the title for the content

description : the description for the content, used as a blog summary or blurb

author : the author of the post

featured_image : image used in the blog hero and blog card

tags : an array of tags pertaining to the blog post

categories : categories this post belong in

Subscribe to get updates to this site!

Like my articles? Enter your details and I will send you an email whenever the site has new content. I will not use your email for any other purpose.

Subscribe