diff --git a/site/app/about/page.jsx b/site/app/about/page.jsx index 8432475..da10443 100644 --- a/site/app/about/page.jsx +++ b/site/app/about/page.jsx @@ -3,6 +3,11 @@ import UserCard from '../components/UserCard.jsx'; import './AboutUs.css'; import fetchStaticJSON from '../utils/fetchStaticJSON.js'; +export const metadata = { + title: "About Us", + description: "Meet the VTMUNC Secretariat: dedicated leaders organizing an inspiring conference. Learn about their roles, backgrounds, and commitment to global diplomacy." +} + async function AboutUs() { const secretariat = await fetchStaticJSON("/app/data/secretariat.json"); diff --git a/site/app/committees/[slug]/page.jsx b/site/app/committees/[slug]/page.jsx index 6219f06..769b78e 100644 --- a/site/app/committees/[slug]/page.jsx +++ b/site/app/committees/[slug]/page.jsx @@ -3,6 +3,8 @@ import fetchStaticJSON from '@/app/utils/fetchStaticJSON'; import UserCard from '@/app/components/UserCard'; import './CommitteeDetails.css'; import FormattedParagraph from '@/app/components/FormattedParagraph'; +import { notFound } from 'next/navigation'; + function findCommittee(committeeGroups, queryId) { for (const group of committeeGroups) { @@ -12,10 +14,27 @@ function findCommittee(committeeGroups, queryId) { } } } - + return null; } +export async function generateMetadata({ params }) { + const committeeGroups = await fetchStaticJSON("/app/data/committees.json"); + const id = params.slug; + const committee = findCommittee(committeeGroups, id); + + if (!committee) { + notFound(); + } + + const title = committee.committee_name.substring(0, 60); // Ensure title is not too long + const description = committee.committee_bio.substring(0, 160); // Ensure description is not too long + + return { + title, + description, + }; +} export default async function CommitteeDetailsPage({params}) { const committeeGroups = await fetchStaticJSON("/app/data/committees.json"); @@ -24,7 +43,10 @@ export default async function CommitteeDetailsPage({params}) { const committee = findCommittee(committeeGroups, id); if (!committee) { - return NextResponse.rewrite(new URL('/404', request.url)); + return { + title: "Page not found", + description: "Page you're looking for doesn't exist. ." + } } const isOneChair = committee.co_chair_name == null; diff --git a/site/app/committees/page.jsx b/site/app/committees/page.jsx index 2dc5cae..1c56aa1 100644 --- a/site/app/committees/page.jsx +++ b/site/app/committees/page.jsx @@ -3,9 +3,13 @@ import Committee from '../components/Commitee'; import './Committees.css'; import fetchStaticJSON from '../utils/fetchStaticJSON'; +export const metadata = { + title: "Committees", + description: "Explore the heart of VTMUNC on our Committees page! Discover detailed information about each committee, including topics of discussion, background guides, and key objectives. Our committees cover a diverse range of global issues, providing a platform for delegates to engage in meaningful debates and develop solutions. Whether you're interested in international security, economic development, or human rights, the VTMUNC Committees page offers everything you need to prepare for and excel in your sessions. Enhance your Model United Nations experience by learning about the committees and their critical roles at VTMUNC. Visit now to get started! " +} + async function Committees() { const committeeGroups = await fetchStaticJSON("/app/data/committees.json"); - return (
diff --git a/site/app/components/Footer.jsx b/site/app/components/Footer.jsx index 3562e34..f5f9714 100644 --- a/site/app/components/Footer.jsx +++ b/site/app/components/Footer.jsx @@ -10,7 +10,7 @@ function Footer() {
-

VTMUNC 2024

+

VTMUNC 2025

Virginia Tech, Blacksburg, VA 24061
diff --git a/site/app/components/Navbar.jsx b/site/app/components/Navbar.jsx index a3a160f..bf1b915 100644 --- a/site/app/components/Navbar.jsx +++ b/site/app/components/Navbar.jsx @@ -13,7 +13,7 @@ function Navbar() { const navbarStyle = isHomePage ? 'navbar-transparent' : ''; return ( -