GX8002: component is not declared in this collection
A content file uses a component tag that is not in the Components list of its collection.
Cause
A content file uses a component tag that is not in the Components list of its collection.
Example
---
title: Start
---
# Start
<site.Note>Read this first.</site.Note>package site
props {
Children gx.Node
}
<aside>{p.Children}</aside>package 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:7:1: GX8002: component "Note" is not declared in this collectionFix
- Add the component to the
Componentscall of the collection. - Or remove the tag from the content file.