From d44d8079675517d53b8459585b712387de89b30b Mon Sep 17 00:00:00 2001 From: Alasdair Wilson Date: Thu, 26 Oct 2023 15:50:21 +0100 Subject: [PATCH 1/5] templatise institute specific parts of the site --- components/Footer.tsx | 17 +++++++--- components/Header.tsx | 16 +++++++-- components/Layout.tsx | 8 +++-- config/oxford.yaml | 28 +++++++++++++++ lib/pageTemplate.ts | 24 +++++++++++++ package.json | 2 ++ pages/event/[eventId].tsx | 9 +++-- pages/event/[eventId]/[eventGroupId].tsx | 9 +++-- pages/index.tsx | 34 ++++++------------- pages/material/[themeId].tsx | 9 +++-- pages/material/[themeId]/[courseId].tsx | 9 +++-- .../[themeId]/[courseId]/[sectionId].tsx | 9 +++-- pages/material/index.tsx | 8 +++-- yarn.lock | 17 ++++++---- 14 files changed, 142 insertions(+), 57 deletions(-) create mode 100644 config/oxford.yaml create mode 100644 lib/pageTemplate.ts diff --git a/components/Footer.tsx b/components/Footer.tsx index 3c5dc58..1698fde 100644 --- a/components/Footer.tsx +++ b/components/Footer.tsx @@ -1,15 +1,22 @@ import React from 'react' +import { GetStaticProps } from 'next' +import { makeSerializable } from 'lib/utils' import Image from 'next/image' import { HiArrowCircleLeft, HiArrowCircleRight } from 'react-icons/hi' import ExternalLink from './ui/ExternalLink' import { ThemeButton } from './ui/ThemeSwitcher' +import { PageTemplate } from 'lib/pageTemplate' +import { Markdown } from 'components/content/Content' interface Props { prevUrl?: string, - nextUrl?: string + nextUrl?: string, + pageInfo?: PageTemplate, } -const Footer: React.FC = ({ prevUrl, nextUrl }) => { + +const Footer: React.FC = ({ prevUrl, nextUrl, pageInfo}) => { + const footerAttrib = pageInfo?.footer; return (