| name | fetch-content |
| description | Fetch and rebuild static Contentful content for the Heroic Adventures App using the project content pipeline. |
fetch-content Skill
Purpose:
Automate fetching and building static content from Contentful for the Heroic Adventures App.
When to Use:
- When updating or rebuilding the static content in
dist/content.
- When Contentful data or schemas change.
Instructions:
- Ensure
.env is configured with valid Contentful credentials.
- Run
npm run content or npx tsx scripts/fetch-content.ts.
- The script fetches all
ruleReference entries and referenced assets.
- Output is written to
dist/content/ as JSON and HTML files.
- Validate output structure matches:
dist/content/categories.json
dist/content/<category>/list.json
dist/content/<category>/<slug>/entry.json
dist/content/<category>/<slug>/content.html
- If adding new categories or fields, update mapping in
scripts/fetch-content.ts.
- Always run
npm test after content build to verify integrity.
Code Example:
npm run content
npm test
Related Files:
scripts/fetch-content.ts
.env.example
README.md