SPB Git

Repository Public

layout.tsx 1.6 KB 36 lines tsx

1import { OfflineBanner, PreviewBanner } from "@/components/layout/Banners";2import { Footer } from "@/components/layout/Footer";3import { Header, type NavItem } from "@/components/layout/Header";4import { getCourse } from "@/lib/content";56/**7 * Public pages are rendered at request time from the live publications: publishing, scheduling and rolling8 * back in the studio take effect at once, without a rebuild, and there is no cached copy of a withdrawn page9 * to serve by mistake. No cookie is read or written here: learners stay anonymous.10 */11export const dynamic = "force-dynamic";1213export default async function PublicLayout({ children }: { children: React.ReactNode }) {14  const course = await getCourse();15  const nav: NavItem[] = [16    { href: "/programme", label: "Programme" },17    { href: "/parcours", label: "Parcours" },18    { href: "/laboratoires", label: "Laboratoires" },19    { href: "/ressources", label: "Ressources" },20    { href: "/glossaire", label: "Glossaire" },21    ...(course.diagrams.length ? [{ href: "/schemas", label: "Schémas" }] : []),22    { href: "/a-propos", label: "À propos" },23    ...(course.mode === "preview" ? [{ href: "/apercu", label: "Aperçu" }] : []),24  ];25  return (26    <>27      <a href="#contenu" className="sr-only-focusable fixed left-3 top-3 z-[60] rounded-full bg-fg px-4 py-2 font-medium text-bg">Aller au contenu</a>28      {course.mode === "preview" && <PreviewBanner />}29      <Header items={nav} />30      <main id="contenu" tabIndex={-1} className="outline-none">{children}</main>31      <Footer course={course} />32      <OfflineBanner />33    </>34  );35}36
Files main
Menu

Theme