--- import { getCollection, render } from 'astro:content'; import fs from 'node:fs'; import path from 'node:path'; import Doc from '../../layouts/Doc.astro'; import { SKILL_CATEGORIES } from '../../data/sub-pages-data'; export async function getStaticPaths() { const entries = await getCollection('skills'); const referenceEntries = await getCollection('reference'); const metadataPath = path.join(process.cwd(), 'skill/scripts/command-metadata.json'); const commandMetadata = JSON.parse(fs.readFileSync(metadataPath, 'utf-8')); const allCommands = entries.map(e => ({ slug: e.id, category: SKILL_CATEGORIES[e.id] || 'system', })); return [ ...entries.map(entry => ({ params: { slug: entry.id }, props: { entry, kind: 'command', metadata: commandMetadata[entry.id] || { description: entry.data.tagline, argumentHint: '' }, allCommands, }, })), ...referenceEntries.map(entry => ({ params: { slug: entry.id }, props: { entry, kind: 'reference', metadata: { description: entry.data.description, argumentHint: '' }, allCommands, }, })), ]; } const { entry, kind, metadata, allCommands } = Astro.props; const { Content } = await render(entry); const slug = entry.id; const category = SKILL_CATEGORIES[slug] || 'system'; const isReference = kind === 'reference'; ---