--- import BaseLayout from "../../../layouts/BaseLayout.astro"; import SiteHeader from "../../../components/SiteHeader.astro"; import SiteFooter from "../../../components/SiteFooter.astro"; import { navigationItems } from "../../../lib/navigation"; import { getArticles } from "../../../lib/news"; const allArticles = await getArticles(); const currentPage = Number(Astro.params.page ?? "1"); const PER_PAGE = 6; const totalPages = Math.ceil(allArticles.length / PER_PAGE); const start = (currentPage - 1) * PER_PAGE; const pagedArticles = allArticles.slice(start, start + PER_PAGE); const pageHref = (page: number) => (page === 1 ? "/events" : `/events/page/${page}`); const pageSeo = { title: `News — Page ${currentPage}`, description: "Stay updated with Highland Group RDA news, events, and stories.", keywords: "Highland RDA news, RDA events, disability riding stories, RDA updates", canonicalPath: `/events/page/${currentPage}`, }; const categoryColors: Record = { News: { bg: "#e8f0e7", text: "#4a7040" }, Events: { bg: "#e7eaf5", text: "#3a4a80" }, Fundraising: { bg: "#fdf3cc", text: "#7a6010" }, }; function formatDate(date: string) { const d = new Date(date); if (isNaN(d.getTime())) return date; return d.toLocaleDateString("en-GB", { day: "numeric", month: "long", year: "numeric" }); } ---

Events & News — Page {currentPage}

What's on at Highland Group RDA.

{pagedArticles.map((post) => ( {totalPages > 1 && ( )}