From e7c3aa70a7512a78b96bdbfce89cd09932a91842 Mon Sep 17 00:00:00 2001 From: Laurenz Sommerlad <36761347+LaurenzSommerlad@users.noreply.github.com> Date: Wed, 14 Aug 2024 00:52:17 +0200 Subject: [PATCH] feat: structured data added (#122) * fixed main page audit issues * fixed e-lab page audit * e-lab person card added alt text for logos * minor edit in venture desciption on members page * canonical link fixed * hompage image size ratio changed to align with rest * structured data added for tum.ai homepage * venture structured data added * people structured data added --- app/e-lab/[id]/page.tsx | 399 +++++++++++++++------------ app/e-lab/page.tsx | 595 ++++++++++++++++++++++------------------ app/page.tsx | 213 +++++++++++--- data/e-lab.tsx | 2 +- package.json | 1 + 5 files changed, 730 insertions(+), 480 deletions(-) diff --git a/app/e-lab/[id]/page.tsx b/app/e-lab/[id]/page.tsx index f48b5b6..90283b2 100644 --- a/app/e-lab/[id]/page.tsx +++ b/app/e-lab/[id]/page.tsx @@ -6,6 +6,7 @@ import Link from "next/link"; import NotFound from "next/dist/client/components/not-found-error"; import Section from "@components/ui/Section"; import Image from "next/image"; +import {ProfilePage, WithContext} from "schema-dts"; export function generateStaticParams() { return team.map((person) => ({ @@ -34,204 +35,256 @@ export default function Page({params: {id}}: { params: { id: string } }) { if (!person) { return ; } + + const jsonLd: WithContext = { + '@context': 'https://schema.org', + '@type': 'ProfilePage', + mainEntity: { + '@type': 'Person', + identifier: person.id, + name: person.firstName + ' ' + person.lastName, + givenName: person.firstName, + familyName: person.lastName, + description: person.description, + image: 'https://www.tum-ai.com' + person.imgSrc, + email: person.email, + worksFor: { + '@type': 'EmployeeRole', + roleName: person.role, + worksFor: { + '@type': 'Organization', + name: 'Venture Department', + alternateName: 'AI Entrepreneurship Lab', + url: 'https://www.tum-ai.com/e-lab', + }, + }, + memberOf: { + '@type': 'Organization', + name: 'TUM.ai', + alternateName: 'TUM.ai Student Initiative', + legalName: 'TUM.ai e.V.', + url: 'https://www.tum-ai.com', + }, + url: 'https://www.tum-ai.com/e-lab/' + person.id, + sameAs: [ + person.linkedin, + person.x ? person.x : "", + person.instagram ? person.instagram : "", + person.youtube ? person.youtube : "", + person.website ? person.website : "", + ], + }, + } + return( -
-
-
-
- - - -
-

- {person.firstName} {person.lastName} -

-
+
+
+ {/* Add JSON-LD to your page */} +