|
| 1 | +# Cigen Documentation - Astro Starlight Guidelines |
| 2 | + |
| 3 | +## Critical Rules |
| 4 | + |
| 5 | +### Never Use H1 Headers in Content |
| 6 | + |
| 7 | +**NEVER** start MDX pages with an H1 (`# Header`) - Starlight automatically |
| 8 | +generates the H1 from the frontmatter `title`. |
| 9 | + |
| 10 | +❌ **Wrong:** |
| 11 | + |
| 12 | +```mdx |
| 13 | +--- |
| 14 | +title: MCP Server Configuration |
| 15 | +--- |
| 16 | + |
| 17 | +# MCP Server Configuration |
| 18 | + |
| 19 | +Content here... |
| 20 | +``` |
| 21 | + |
| 22 | +✅ **Correct:** |
| 23 | + |
| 24 | +```mdx |
| 25 | +--- |
| 26 | +title: MCP Server Configuration |
| 27 | +--- |
| 28 | + |
| 29 | +Content here starts immediately, or with H2 (## Section) |
| 30 | +``` |
| 31 | + |
| 32 | +### Component Imports |
| 33 | + |
| 34 | +Always import Starlight components at the top: |
| 35 | + |
| 36 | +```mdx |
| 37 | +import { |
| 38 | + Card, |
| 39 | + CardGrid, |
| 40 | + LinkCard, |
| 41 | + Tabs, |
| 42 | + TabItem, |
| 43 | + Steps, |
| 44 | + Code, |
| 45 | + Aside, |
| 46 | +} from '@astrojs/starlight/components'; |
| 47 | + |
| 48 | +; |
| 49 | +``` |
| 50 | + |
| 51 | +### Best Practices |
| 52 | + |
| 53 | +1. **Structure**: Start content immediately after frontmatter, use H2 for main |
| 54 | + sections |
| 55 | +2. **Components**: Use `<Steps>` for numbered procedures, `<Tabs>` for |
| 56 | + platform-specific content |
| 57 | +3. **Cards**: Don't overuse CardGrid - simple lists are often better for |
| 58 | + readability |
| 59 | +4. **Code blocks**: Use proper language tags for syntax highlighting |
| 60 | +5. **Links**: Use LinkCard for prominent external links, regular markdown links |
| 61 | + for inline references |
| 62 | + |
| 63 | +### Common Components |
| 64 | + |
| 65 | +- `<Steps>` - Numbered step-by-step instructions |
| 66 | +- `<Tabs>` and `<TabItem>` - Platform or option-specific content |
| 67 | +- `<LinkCard>` - Prominent navigation to other pages |
| 68 | +- `<Aside type="note|tip|caution|danger">` - Callout boxes |
| 69 | +- `<Code>` - Inline code with syntax highlighting |
| 70 | + |
| 71 | +### File Structure |
| 72 | + |
| 73 | +- Use kebab-case for file names: `mcp-server-config.mdx` |
| 74 | +- Organize in logical directories: `mcp/`, `commands/`, `examples/` |
| 75 | +- Use `overview.mdx` for main landing pages in sections |
| 76 | + |
| 77 | +### Frontmatter Requirements |
| 78 | + |
| 79 | +Always include both title and description: |
| 80 | + |
| 81 | +```yaml |
| 82 | +--- |
| 83 | +title: Clear, Descriptive Title |
| 84 | +description: Brief description for SEO and navigation |
| 85 | +--- |
| 86 | +``` |
| 87 | + |
| 88 | +### Code Examples |
| 89 | + |
| 90 | +When showing cigen CLI output or configuration: |
| 91 | + |
| 92 | +- Use YAML syntax highlighting for config files |
| 93 | +- Use bash syntax highlighting for CLI commands |
| 94 | +- Show both input config and generated output when relevant |
| 95 | +- Use `--config path/to/config` flag in examples |
| 96 | + |
| 97 | +### Testing Guidelines |
| 98 | + |
| 99 | +- Always test configuration examples with `cigen validate` |
| 100 | +- Verify generated CI configs with provider CLI tools (e.g., `circleci config validate`) |
| 101 | +- Test all links and ensure they work in the local dev server |
| 102 | +- Use realistic but simple examples that demonstrate key concepts |
| 103 | + |
| 104 | +### Sidebar Configuration |
| 105 | + |
| 106 | +- Keep sidebar items concise and well-organized |
| 107 | +- Use autogenerate for large directories: |
| 108 | + `autogenerate: { directory: "commands" }` |
| 109 | +- Group related items under clear labels |
| 110 | +- Put most important sections (like MCP Server) near the top |
0 commit comments