Skip to content

Commit 0f1e722

Browse files
authored
Merge branch 'ep2025' into ep2025-sponsorship
2 parents 0202275 + 6f3e5e0 commit 0f1e722

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
export interface Props {
3+
title: string;
4+
id: string;
5+
}
6+
7+
const { title, id } = Astro.props;
8+
---
9+
10+
<details class="group mb-4">
11+
<summary
12+
aria-expanded="false"
13+
aria-controls={id}
14+
class="cursor-pointer flex justify-between p-2 rounded-md border-t border-b focus:ring-2"
15+
>
16+
<span class="font-semibold">{title}</span>
17+
<span aria-hidden="true" class="group-open:hidden">+</span>
18+
<span aria-hidden="true" class="group-open:block hidden">−</span>
19+
</summary>
20+
21+
<div id={id} class="pl-4">
22+
<slot />
23+
</div>
24+
</details>

src/content/pages/test.mdx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,3 +270,22 @@ Barking up the right tree
270270

271271
## YouTube
272272
<YouTube id="j5a0jTc9S10" alt="Mood lifter" />
273+
274+
## Accordion
275+
#### What do the dogs say?
276+
277+
<Accordion title="Spanish-speaking dogs" id="spanish">
278+
**Guau guau!**
279+
</Accordion>
280+
281+
<Accordion title="Italian-speaking dogs" id="italian">
282+
*Bau bau!*
283+
</Accordion>
284+
285+
<Accordion title="Japanese-speaking dogs" id="japanese">
286+
ワンワン
287+
</Accordion>
288+
289+
<Accordion title="Finnish-speaking dogs" id="finnish">
290+
***Hau hau!***
291+
</Accordion>

src/pages/[...slug].astro

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import HighlightCard from "../components/highlight-list/highlight-card.astro";
1414
import HighlightItem from "../components/highlight-list/highlight-item.astro";
1515
import { Note } from "../components/note";
1616
import SponsorTiers from "../components/sponsor-tiers/sponsor-tiers.astro";
17+
import Accordion from "../components/accordion/accordion.astro";
1718
1819
export async function getStaticPaths() {
1920
const posts = await getCollection("pages");
@@ -48,6 +49,7 @@ const description = post.data.subtitle;
4849
Note,
4950
SponsorTiers,
5051
hr: Separator,
52+
Accordion
5153
}}
5254
/>
5355
</Prose>

0 commit comments

Comments
 (0)