Skip to content

Commit 583d094

Browse files
authored
Merge pull request #268 from pyladies/docs-categories
Enable grouping/sections in the documentation
2 parents c1286b3 + 4e8dda6 commit 583d094

21 files changed

+366
-204
lines changed

astro.config.mjs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,14 @@ export default defineConfig({
4848
extendDefaultPlugins: true,
4949
highlighter: getHighlighter,
5050
},
51+
redirects: {
52+
"/docs/committee_communications": "/docs/volunteers/committee_communications",
53+
"/docs/committee_design": "/docs/volunteers/committee_design",
54+
"/docs/committee_finance": "/docs/volunteers/committee_finance",
55+
"/docs/committee_infra": "/docs/volunteers/committee_infra",
56+
"/docs/committee_program": "/docs/volunteers/committee_program",
57+
"/docs/committee_volunteers": "/docs/volunteers/committee_volunteers",
58+
"/docs/roles_and_responsibilities": "/docs/volunteers/roles_and_responsibilities",
59+
"/docs/speaker_guide": "/docs/speakers/speaker_guide",
60+
}
5161
});

src/content.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ const docsCollection = defineCollection({
6060
image: z.string().optional(),
6161
layout: z.string().optional(),
6262
draft: z.boolean().optional(),
63+
section: z.string().optional(),
6364
weight: z.number().optional(),
65+
url: z.string().url().optional(), // only for external links
6466
}),
6567
});
6668

src/content/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<!--
2+
Adding empty file to prevent GitHub showing src/content/docs/README.md
3+
Please add content to this file as needed.
4+
-->

src/content/docs/README.md

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
---
2+
draft: true
3+
title: "Documentation Inception"
4+
---
5+
6+
# Documentation
7+
8+
This directory contains all documentation organized into sections.
9+
10+
## Structure
11+
12+
- **`volunteers/`** - Guides for conference volunteers and committee members
13+
- **`speakers/`** - Information and guides for speakers
14+
- **`resources/`** - External resources and helpful links
15+
16+
## Adding a New Doc
17+
18+
Create a markdown file in the appropriate subfolder:
19+
20+
```bash
21+
# For volunteer guides
22+
src/content/docs/volunteers/your-guide.md
23+
24+
# For speaker guides
25+
src/content/docs/speakers/your-guide.md
26+
27+
# For other resources
28+
src/content/docs/resources/your-resource.md
29+
```
30+
31+
## Frontmatter
32+
33+
Basic frontmatter structure:
34+
35+
```yaml
36+
---
37+
title: "Your Doc Title"
38+
description: "Brief description"
39+
section: "volunteers" # optional - inferred from folder if not specified
40+
weight: 1 # optional - controls ordering within section
41+
---
42+
```
43+
44+
## External Resources
45+
46+
To link to an external resource instead of creating a doc page:
47+
48+
```yaml
49+
---
50+
title: "Astro Framework"
51+
description: "Learn about Astro"
52+
section: "resources"
53+
url: "https://astro.build" # opens in new tab with icon
54+
---
55+
```
56+
57+
## Section Ordering
58+
59+
Sections appear in this order:
60+
61+
1. Speakers
62+
2. Volunteers
63+
3. Resources
64+
4. Any other sections (alphabetically)
65+
66+
Within each section, docs are sorted by `weight` (lower numbers first).
67+
68+
## Creating a New Section
69+
70+
You can add new sections by simply creating a new folder:
71+
72+
```bash
73+
src/content/docs/sponsors/sponsor-info.md
74+
```
75+
76+
This will automatically create a "Sponsors" section. The section name is inferred from the folder name and humanized (e.g., `my-section` becomes "My Section").
77+
78+
### Customizing Section Labels and Order
79+
80+
To customize section display names and ordering, edit `src/lib/utils/docsHelpers.ts`:
81+
82+
**1. Add a custom label:**
83+
84+
```typescript
85+
const SECTION_LABELS: Record<string, string> = {
86+
volunteers: "Volunteer Guides",
87+
speakers: "Speaker Guides",
88+
resources: "Resources",
89+
sponsors: "Sponsor Information", // add your new section here
90+
};
91+
```
92+
93+
**2. Add to the ordering:**
94+
95+
```typescript
96+
const SECTION_ORDER = ["speakers", "volunteers", "resources", "sponsors"] as const;
97+
```
98+
99+
Sections not in `SECTION_ORDER` will appear after the ordered ones, sorted alphabetically.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: "Astro"
3+
meta_title: "Astro Framework"
4+
description: "The framework for this website, in case you want to contribute to it."
5+
draft: false
6+
section: "resources"
7+
weight: 1
8+
url: "https://astro.build"
9+
---
10+
11+
Astro is the web framework used to build this PyLadiesCon website. If you're interested in contributing to the website, learning Astro will help you understand how the site is structured and how to make improvements. Visit the [Astro Documentation](https://docs.astro.build) to get started with Astro!

src/content/docs/speaker_guide.md renamed to src/content/docs/speakers/speaker_guide.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ meta_title: "Speaker Guide"
44
description: "Guide and Resources for Speakers"
55
draft: false
66
weight: 1
7+
section: "speakers"
78
---
89

910

src/content/docs/committee_communications.md renamed to src/content/docs/volunteers/committee_communications.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ meta_title: "Communications Committee"
44
description: "Team in charge of all the internal and external communications"
55
draft: false
66
weight: 5
7+
section: "volunteers"
78
---
89

910
## Roles

src/content/docs/committee_design.md renamed to src/content/docs/volunteers/committee_design.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ meta_title: "Design Committee"
44
description: "Team in charge of the creation of all the conference assets"
55
draft: false
66
weight: 6
7+
section: "volunteers"
78
---
89

910
## Roles

src/content/docs/committee_finance.md renamed to src/content/docs/volunteers/committee_finance.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ meta_title: "Finance and Sponsorship Committee"
44
description: "Team in charge of the budget and sponsorship of the confenrence"
55
draft: false
66
weight: 3
7+
section: "volunteers"
78
---
89

910

src/content/docs/committee_infra.md renamed to src/content/docs/volunteers/committee_infra.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ description: "Team in charge of the infra in the conference including website,
55
bots, ticketing system, streaming, etc."
66
draft: false
77
weight: 4
8+
section: "volunteers"
89
---
910

1011
## Roles

0 commit comments

Comments
 (0)