Skip to content

Commit 17acd0f

Browse files
committed
Enhance Copilot instructions with detailed front matter requirements and link syntax examples
1 parent 8bd124d commit 17acd0f

1 file changed

Lines changed: 68 additions & 6 deletions

File tree

.github/copilot-instructions.md

Lines changed: 68 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Gemfile # Ruby dependencies (jekyll ~> 4.3, just-the-docs ~> 0.8)
1414
## Documentation Conventions
1515

1616
### Front Matter for Doc Pages
17-
All pages in `docs/` should have front matter. The just-the-docs theme uses `nav_order` for menu position:
17+
All pages in `docs/` must have YAML front matter. The just-the-docs theme uses these fields:
1818

1919
```yaml
2020
---
@@ -24,8 +24,33 @@ nav_order: 3
2424
---
2525
```
2626

27+
| Field | Required | Description |
28+
|-------|----------|-------------|
29+
| `layout` | Yes | Always use `default` |
30+
| `title` | Yes | Appears in navigation sidebar |
31+
| `nav_order` | Yes | Lower numbers appear higher in nav (1, 2, 3...) |
32+
| `parent` | No | For nested pages, reference parent's `title` |
33+
| `has_children` | No | Set to `true` if page has child pages |
34+
35+
### Link Syntax
36+
**Internal links between doc pages use relative paths without leading slash:**
37+
```markdown
38+
<!-- Correct - relative to current file -->
39+
[PLG File Reference](plg-file.md)
40+
[Getting Started](getting-started.md)
41+
42+
<!-- Wrong - these will break -->
43+
[PLG File Reference](/docs/plg-file.md)
44+
[PLG File Reference](docs/plg-file.md)
45+
```
46+
47+
**Anchor links for same-page sections:**
48+
```markdown
49+
[See Events section](#available-events)
50+
```
51+
2752
### Markdown Style
28-
- Use `#` for the main title (matches `title` in front matter)
53+
- Use `#` for the main title (should match `title` in front matter)
2954
- Tables for reference information (attributes, commands, events)
3055
- Code blocks with language hints: ` ```xml `, ` ```php `, ` ```bash `
3156
- ASCII diagrams for architecture/flow concepts (see `docs/filesystem.md` for examples)
@@ -68,10 +93,47 @@ This documentation covers Unraid-specific patterns. When writing or editing:
6893

6994
## Adding New Documentation Pages
7095

71-
1. Create `docs/new-topic.md` with proper front matter
72-
2. Add to navigation in the appropriate section (see `index.md` links)
73-
3. Cross-reference from related pages
74-
4. Include working code examples from real plugins like `dynamix.*` or `compose.manager`
96+
### Step-by-step process:
97+
1. Create `docs/new-topic.md` with required front matter
98+
2. Set `nav_order` to position it correctly (check existing pages for numbering)
99+
3. Add cross-reference links from related pages using relative syntax
100+
4. Update `index.md` if adding to the main navigation sections
101+
5. Include working code examples from real plugins
102+
103+
### Template for new page:
104+
```markdown
105+
---
106+
layout: default
107+
title: Your Topic Title
108+
nav_order: 10
109+
---
110+
111+
# Your Topic Title
112+
113+
Brief introduction explaining what this topic covers.
114+
115+
## Section One
116+
117+
Content with code examples:
118+
119+
\`\`\`php
120+
<?php
121+
// Example code here
122+
?>
123+
\`\`\`
124+
125+
## Next Steps
126+
127+
- [Related Topic](related-topic.md)
128+
- [Another Topic](another-topic.md)
129+
```
130+
131+
### Checklist before committing:
132+
- [ ] Front matter has `layout: default`, `title`, and `nav_order`
133+
- [ ] Main `# heading` matches `title` in front matter
134+
- [ ] Internal links use relative paths (e.g., `plg-file.md` not `/docs/plg-file.md`)
135+
- [ ] Code blocks have language hints for syntax highlighting
136+
- [ ] Tested locally with `bundle exec jekyll serve`
75137

76138
## External References
77139

0 commit comments

Comments
 (0)