Add password-protected NCERT workshop pages
This commit is contained in:
parent
3f53d3c289
commit
3c694517fc
12 changed files with 871 additions and 16 deletions
25
src/pages/ncert/[page].astro
Normal file
25
src/pages/ncert/[page].astro
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
---
|
||||
import EventPage from "../../components/EventPage.astro";
|
||||
import { getEventByParams, getEventPageEntries } from "../../data/events";
|
||||
|
||||
export function getStaticPaths() {
|
||||
const event = getEventByParams("2026", "ncert");
|
||||
|
||||
if (!event) return [];
|
||||
|
||||
return getEventPageEntries(event)
|
||||
.filter((pageEntry) => pageEntry.type !== "overview")
|
||||
.map((pageEntry) => ({
|
||||
params: { page: pageEntry.id },
|
||||
props: { event, pageEntry },
|
||||
}));
|
||||
}
|
||||
|
||||
const { event, pageEntry } = Astro.props;
|
||||
|
||||
if (!event || !pageEntry) {
|
||||
return Astro.redirect("/ncert/");
|
||||
}
|
||||
---
|
||||
|
||||
<EventPage event={event} pageEntry={pageEntry} />
|
||||
Loading…
Add table
Add a link
Reference in a new issue