From e3bf993af553443810f03f1f6fbfde36b9800f86 Mon Sep 17 00:00:00 2001 From: Pedro Martin Date: Wed, 22 Jan 2025 15:56:22 +0000 Subject: [PATCH] feat: add schema.org metadata to publications page --- .../src/app/[lang]/publications/page-body.tsx | 27 ++++++++++++++---- website/src/app/[lang]/publications/page.tsx | 28 +++++-------------- .../app/[lang]/register-a-patient/page.tsx | 1 + website/src/models/metadata/index.ts | 1 + 4 files changed, 31 insertions(+), 26 deletions(-) diff --git a/website/src/app/[lang]/publications/page-body.tsx b/website/src/app/[lang]/publications/page-body.tsx index 173e7a9..edd7895 100644 --- a/website/src/app/[lang]/publications/page-body.tsx +++ b/website/src/app/[lang]/publications/page-body.tsx @@ -17,6 +17,7 @@ import { patientResearchContentId, } from '@models/paragraphs'; import { createHashLink } from '@shared/utils/hash-links'; +import type { ScholarlyArticle, WithContext } from 'schema-dts'; interface RegisterPageBodyProps { lang: AvailableLocale; @@ -95,11 +96,27 @@ const PublicationsByYear: React.FC = ({

{year}

    - {publications.map(({ title, link }) => ( -
  • - {title} -
  • - ))} + {publications.map(({ title, link }) => { + const scholaryArticle: WithContext = { + '@context': 'https://schema.org', + '@type': 'ScholarlyArticle', + name: title, + url: link, + }; + + return ( +
  • +