Skip to content

Commit

Permalink
Opengraph: handle null description
Browse files Browse the repository at this point in the history
  • Loading branch information
abhiramtilakiiit committed Dec 11, 2024
1 parent 513ab14 commit 12ea493
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/app/events/[id]/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { notFound } from "next/navigation";
import { getFile, PUBLIC_URL } from "utils/files";
import EventDetails from "components/events/EventDetails";
import { locationMap } from "constants/events";
import { description } from "app/layout";

import dayjs from "dayjs";

Expand All @@ -23,7 +24,7 @@ export async function generateMetadata({ params }) {

return {
title: `${event.name} (Time: ${time}, Location: ${locationMap[event.location]})`,
description: event.description,
description: event.description ? event.description : description,
openGraph: {
images: [
{
Expand Down
2 changes: 1 addition & 1 deletion src/app/layout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import TransitionProvider from "components/TransitionProvider";
import { headers } from "next/headers";
import { PUBLIC_URL } from "utils/files";

const description =
export const description =
"Discover the vibrant campus life at IIIT Hyderabad. Explore diverse student-led clubs and bodies, and events that foster an inclusive community and enrich student experiences beyond the classroom. Stay updated on activities, events, and opportunities to engage and grow at IIIT-H.";
const shortDescription =
"Explore with the Life @ IIIT Hyderabad for diverse student-led clubs and bodies & events that enrich campus life and foster community.";
Expand Down

0 comments on commit 12ea493

Please sign in to comment.