GX8001: frontmatter is malformed or unknown
The frontmatter of a content file has an error.
Cause
The frontmatter of a content file has one of three errors. It is not valid YAML. A value has the wrong type. A key is not a field of the Meta type of the collection.
Example
---
title: Start
author: Ada
---
# Startpackage site
import "github.com/alternayte/gx"
// Meta is the frontmatter of one page.
type Meta struct {
Title string `yaml:"title"`
}
// Docs is the docs collection.
var Docs = gx.Collection[Meta]("content/docs")gx check reports:
content/docs/start.md:3:1: GX8001: frontmatter: unknown field "author"Fix
- Correct or remove the key that the message names.
- Or add the field to the
Metatype.