Initial events Astro site
This commit is contained in:
commit
69a5937ead
41 changed files with 12166 additions and 0 deletions
87
src/data/eventNav.ts
Normal file
87
src/data/eventNav.ts
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
import { infoPages } from "./info";
|
||||
import {
|
||||
getEventBasePath,
|
||||
getEventPageEntries,
|
||||
type EventPageEntry,
|
||||
type Event,
|
||||
} from "./events";
|
||||
|
||||
function getSectionGroup(page: EventPageEntry) {
|
||||
const planning = new Set([
|
||||
"workshops",
|
||||
"important-dates",
|
||||
"registration-logistics",
|
||||
"contact",
|
||||
"registration",
|
||||
"workshop-registration",
|
||||
"registration-notes",
|
||||
"socials-at-fsttcs-2024",
|
||||
]);
|
||||
const travel = new Set([
|
||||
"internet-access-via-wifi",
|
||||
"accommodation-for-students",
|
||||
"guest-house-and-hotel-accommodation",
|
||||
"fortune-inn-haveli",
|
||||
"for-international-participants",
|
||||
"international-visitor-notes",
|
||||
"reaching-and-leaving-iit-gandhinagar",
|
||||
]);
|
||||
|
||||
if (planning.has(page.id)) return "Planning";
|
||||
if (travel.has(page.id)) return "Travel & Stay";
|
||||
if (page.id !== "overview") return "Venue & Campus";
|
||||
return undefined;
|
||||
}
|
||||
|
||||
export function getEventNavItems(event: Event) {
|
||||
const basePath = getEventBasePath(event);
|
||||
const eventPages = getEventPageEntries(event);
|
||||
const sectionPages = eventPages.filter((page) => page.type === "section");
|
||||
const schedulePage = eventPages.find((page) => page.type === "schedule");
|
||||
const peoplePage = eventPages.find((page) => page.type === "people");
|
||||
const visualPage = eventPages.find((page) => page.type === "visual");
|
||||
|
||||
if (event.slug === "barcamp") {
|
||||
return [
|
||||
...(!event.hideOverviewNav ? [{ label: "Overview", href: basePath }] : []),
|
||||
...(peoplePage ? [{ label: "Participants", href: peoplePage.href }] : []),
|
||||
...(schedulePage ? [{ label: "Schedule", href: schedulePage.href }] : []),
|
||||
{
|
||||
label: "Venue",
|
||||
items: infoPages.map((page) => ({
|
||||
label: page.title,
|
||||
href: `${basePath}info/${page.slug}/`,
|
||||
})),
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
return [
|
||||
...(!event.hideOverviewNav ? [{ label: "Overview", href: basePath }] : []),
|
||||
...(sectionPages.length
|
||||
? [
|
||||
{
|
||||
label: "Details",
|
||||
items: sectionPages.map((page) => ({
|
||||
label: page.label,
|
||||
href: page.href,
|
||||
group: sectionPages.length >= 16 ? getSectionGroup(page) : undefined,
|
||||
})),
|
||||
},
|
||||
]
|
||||
: []),
|
||||
...(schedulePage ? [{ label: "Schedule", href: schedulePage.href }] : []),
|
||||
...(peoplePage ? [{ label: "Participants", href: peoplePage.href }] : []),
|
||||
...(visualPage ? [{ label: "Visuals", href: visualPage.href }] : []),
|
||||
{
|
||||
label: "Information",
|
||||
items: infoPages.map((page) => ({
|
||||
label: page.title,
|
||||
href: `${basePath}info/${page.slug}/`,
|
||||
})),
|
||||
},
|
||||
...(event.sourceUrl
|
||||
? [{ label: "Event website", href: event.sourceUrl, external: true }]
|
||||
: []),
|
||||
];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue