Parse the front matter / markdown metadata of files in a directory into a JSON array.
This action outputs a JSON array which can be commited as a file, and is useful for CI purposes.
Required The path to the directory containing files with front matter.
An example file in the directory might look like:
---
name: QWERTY
date: 2000-01-01
slug: qwerty
excerpt: A popular keyboard layout
---
Qwerty is the first keyboard layout many .......
...The name of the field containing everything after the front matter. Defaults to content
The JSON array containing the front matter and content.
It's shape will look like this:
[
{
"frontmatter1": "value",
"frontmatter2": "value",
"frontmatterN": "value",
"content": "content"
},
{
"frontmatter1": "value",
"frontmatter2": "value",
"frontmatterN": "value",
"content": "content"
},
...
]uses: actions/checkout@v2
uses: yzalvin/action-yaml-front-matter@v1
with:
input-directory: './demo'
content-field: 'description'