mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-12 22:26:38 +03:00
* Add design-aware detector rules * Fix design-aware detector noise * Unify CLI and hook detector ignores * Fix remaining design-system review findings * Add detector ignore CLI * Fix design detector review findings * Fix design color source false positives * Fix core test suite registration * Add design-aware detector docs * Fix font priority design-system parsing * Fix color ignore value matching
60 lines
1.6 KiB
Plaintext
60 lines
1.6 KiB
Plaintext
---
|
|
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';
|
|
---
|
|
|
|
<Doc
|
|
title={isReference ? entry.data.title : slug}
|
|
description={metadata.description}
|
|
tagline={entry.data.tagline}
|
|
slug={slug}
|
|
category={category}
|
|
pageKind={kind}
|
|
allCommands={allCommands}
|
|
>
|
|
<Content />
|
|
</Doc>
|