-
Notifications
You must be signed in to change notification settings - Fork 73
Expand file tree
/
Copy path[...slug].astro
More file actions
100 lines (86 loc) · 2.77 KB
/
[...slug].astro
File metadata and controls
100 lines (86 loc) · 2.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
---
import { type CollectionEntry, getCollection } from "astro:content";
import Layout from "@layouts/MarkdownLayout.astro";
import Headline from "@ui/Headline.astro";
import Separator from "@ui/Separator.astro";
import Map from "@components/Map.astro";
import YouTube from "@ui/YouTube.astro";
import HighlightCard from "@components/markdown/HighlightCard.astro";
import Note from "@ui/Note.astro";
import SponsorTiers from "@components/sponsor-tiers/sponsor-tiers.astro";
import Accordion from "@components/ui/Accordion.astro";
import Button from "@ui/Button.astro";
import Icon from "@ui/Icon.astro";
import IconLabel from "@components/markdown/IconLabel.astro";
import Center from "@components/markdown/Center.astro";
import EPSLogo from "@components/markdown/EPSLogo.astro";
import ProfileCard from "@components/profile/ProfileCard.astro";
import SpeakerCard from "@components/profile/SpeakerCard.astro";
import GoogleCalendar from '@components/GoogleCalendar.astro';
import Prose from "@ui/Prose.astro";
import enabledPages from "@data/enabledPages.json";
export async function getStaticPaths() {
const pages = await getCollection("pages");
// Filter pages based on whitelist if enabled
const filteredPages = enabledPages.enableWhitelist
? pages.filter((page) => {
const fullPath = `/${page.slug}`;
const shortSlug = page.slug.split("/").pop();
const shortPath = `/${shortSlug}`;
return enabledPages.pages.includes(fullPath) || enabledPages.pages.includes(shortPath);
})
: pages;
return filteredPages.flatMap((page) => {
const slugParts = page.slug.split("/");
const shortSlug = slugParts[slugParts.length - 1];
const paths = [
{ params: { slug: page.slug }, props: page }, // long slug
];
// only add short slug if it's not the same
if (page.slug !== shortSlug) {
paths.push({ params: { slug: shortSlug }, props: page }); // short slug
}
return paths;
});
}
type Props = CollectionEntry<"pages">;
const post = Astro.props;
const { Content } = await post.render();
let title =
post.data.title +
" | EuroPython 2026 | July 13th-19th 2026 | Kraków, Poland";
const description = post.data.subtitle;
---
<Layout title={title} description={description} toc={post.data.toc}>
<Prose class="pb-20">
<Content
components={{
Button,
Headline,
Icon,
IconLabel,
Center,
EPSLogo,
Map,
YouTube,
HighlightCard,
Note,
SponsorTiers,
hr: Separator,
Accordion,
ProfileCard,
SpeakerCard,
GoogleCalendar
}}
/>
</Prose>
</Layout>
<style is:global>
.speakers-grid {
display: flex;
justify-content: center;
gap: 2rem;
flex-wrap: wrap;
margin: 2rem 0;
}
</style>