Skip to content

Commit d7d0b44

Browse files
authored
Merge branch 'ep2025' into ep2025-buffer
2 parents 99e374e + c2c948a commit d7d0b44

File tree

3 files changed

+27
-4
lines changed

3 files changed

+27
-4
lines changed

src/pages/[code].astro

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
import { getCollection } from "astro:content";
3+
export async function getStaticPaths() {
4+
const sessions = await getCollection("sessions");
5+
return sessions.map((entry) => ({
6+
params: { code: entry.data.code },
7+
props: { slug: entry.id},
8+
}));
9+
}
10+
const { slug } = Astro.props;
11+
return Astro.rewrite(`/session/${slug}`);
12+
---

src/pages/community-partners.astro

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import Layout from "@layouts/SectionLayout.astro";
44
import SponsorCard from "@components/SponsorCard.astro";
55
import Headline from "@ui/Headline.astro";
66
7-
const sponsors = await getCollection("sponsors", ({ data }) => {
7+
const sponsors = (await getCollection("sponsors", ({ data }) => {
88
const isProd = import.meta.env.MODE === "production";
99
const notDraft = !isProd || data.draft !== true;
1010
const isPartner = data.tier === "Partners";
1111
return notDraft && isPartner;
12-
});
12+
})).sort((a, b) => a.id.localeCompare(b.id));
1313
1414
---
1515

@@ -30,4 +30,6 @@ const sponsors = await getCollection("sponsors", ({ data }) => {
3030
))}
3131
</div>
3232
)}
33-
</Layout>
33+
<p class="pb-5">
34+
Are you a Python Community organiser, interested in knowing more about EuroPython Society? Feel free to reach out at [email protected]!
35+
</p></Layout>

src/pages/session/[slug].astro

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export async function getStaticPaths() {
2121
const sessions = await getCollection("sessions");
2222
2323
const { entry } = Astro.props;
24-
24+
const slug = entry.id;
2525
const speakers = await getEntries(entry.data.speakers);
2626
2727
// Resolve session codes to session data
@@ -233,3 +233,12 @@ const nextSessionsOrdered = sameRoomNextSession
233233
</footer>
234234
</Section>
235235
</Layout>
236+
237+
<script is:inline define:vars={{ slug }}>
238+
const currentUrl = window.location.pathname;
239+
const expectedUrl = `/session/${slug}`;
240+
241+
if (currentUrl !== expectedUrl) {
242+
window.history.replaceState({}, '', expectedUrl);
243+
}
244+
</script>

0 commit comments

Comments
 (0)