From 7063b199b4748a9c354ed37e64cdc84c512f2c0c Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Thu, 14 Dec 2023 15:30:34 +0100
Subject: refactor(pages): rewrite helpers to output schema in json-ld format

* make sure url are absolutes
* nest breadcrumb schema in webpage schema
* trim HTML tags from content/description
* use a regular script instead of next/script (with the latter the
schema is not updated on route change)
* place the script in document head
* add keywords, wordCount and readingTime keys in BlogPosting schema
* fix breadcrumbs in search page (without query)
* add tests (a `MatchInlineSnapshot` will be better but Prettier 3 is
not supported yet)
---
 src/components/organisms/comment/approved-comment/approved-comment.tsx | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'src/components/organisms/comment/approved-comment/approved-comment.tsx')

diff --git a/src/components/organisms/comment/approved-comment/approved-comment.tsx b/src/components/organisms/comment/approved-comment/approved-comment.tsx
index d834ba3..6611c11 100644
--- a/src/components/organisms/comment/approved-comment/approved-comment.tsx
+++ b/src/components/organisms/comment/approved-comment/approved-comment.tsx
@@ -1,6 +1,7 @@
 import NextImage from 'next/image';
 import { type ForwardRefRenderFunction, forwardRef, useCallback } from 'react';
 import { useIntl } from 'react-intl';
+import { COMMENT_ID_PREFIX } from '../../../../utils/constants';
 import { Button, Link, Time } from '../../../atoms';
 import {
   Card,
@@ -99,7 +100,7 @@ const ApprovedCommentWithRef: ForwardRefRenderFunction<
 ) => {
   const intl = useIntl();
   const commentClass = `${className}`;
-  const commentId = `comment-${id}`;
+  const commentId = `${COMMENT_ID_PREFIX}${id}`;
   const commentLink = `#${commentId}`;
   const publicationDateLabel = intl.formatMessage({
     defaultMessage: 'Published on:',
-- 
cgit v1.2.3

