Skip to content

Latest commit

 

History

History
24 lines (14 loc) · 909 Bytes

front_matter.md

File metadata and controls

24 lines (14 loc) · 909 Bytes

Validating the front matter in Markdown files

All the source files for the blog are written in Markdown, and at the top they have some structured data, in the form of Front Matter:

---
layout: post
title: Checking lots of URLs with curl
---

I want to make sure I'm using these fields consistently, so I have a JSON Schema definition for my front matter: front-matter.json.

Then I validate every Markdown file's front matter against this schema as part of my linting plugin.

Alternative approaches

  • I considered using the jekyll-data_validation plugin, but you have to run the validation as part of a separate jekyll validate command; I wanted it as part of my existing jekyll lint command.