Sample Component
Overview
This is a sample component file demonstrating the complete frontmatter specification for EcoOS component documentation.
Purpose
This file serves as:
- A template for creating new component documentation
- A test case for the frontmatter parsing system
- A reference for required and optional fields
Frontmatter Fields Used
This component includes all recommended frontmatter fields:
- componentName: "Sample Component" (displayed on card)
- description: Brief description shown on component card
- category: "Sample Components" (for grouping)
- version: "1.0.0" (semantic versioning)
- lastModified: "2025-01-15" (YYYY-MM-DD format)
- CID: Unique component identifier
- documentType: "Specification"
- registryUrl: Link to component marketplace
- tags: Keywords for search engines
Usage
To use this as a template:
- Copy this file
- Rename to your component name
- Update all frontmatter fields
- Replace content with your component documentation
- Run
npm run docs:generate-components
Testing
This component can be used to test:
- Frontmatter parsing
- Category grouping
- Description display
- Metadata extraction
- Link generation
Expected Behavior
When processed by the generate-components script:
- Should appear in "Sample Components" category
- Should display description on component card
- Should show version "1.0.0"
- Should show last modified date "2025-01-15"
- Should be clickable and navigate to this page
Verification
After running npm run docs:generate-components, check:
.vitepress/components.jsonincludes this component- All frontmatter fields are correctly extracted
- Component appears on
/components/page - Component is grouped under "Sample Components"
- Description is visible on the card

