aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/templates/page/page.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2023-12-14 15:30:34 +0100
committerArmand Philippot <git@armandphilippot.com>2023-12-14 16:30:04 +0100
commit7063b199b4748a9c354ed37e64cdc84c512f2c0c (patch)
tree7506c3003c56b49a248e9adb40be610780bb540e /src/components/templates/page/page.tsx
parent85c4c42bd601270d7be0f34a0767a34bb85e29bb (diff)
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)
Diffstat (limited to 'src/components/templates/page/page.tsx')
-rw-r--r--src/components/templates/page/page.tsx5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/components/templates/page/page.tsx b/src/components/templates/page/page.tsx
index b40c2f9..e3a4453 100644
--- a/src/components/templates/page/page.tsx
+++ b/src/components/templates/page/page.tsx
@@ -4,6 +4,7 @@ import {
type HTMLAttributes,
} from 'react';
import { useIntl } from 'react-intl';
+import { ARTICLE_ID } from '../../../utils/constants';
import { Article } from '../../atoms';
import { Breadcrumbs, type BreadcrumbsItem } from '../../organisms/nav';
import styles from './page.module.scss';
@@ -63,7 +64,9 @@ const PageWithRef: ForwardRefRenderFunction<HTMLDivElement, PageProps> = (
items={breadcrumbs}
/>
) : null}
- <Article className={pageClass}>{children}</Article>
+ <Article className={pageClass} id={ARTICLE_ID}>
+ {children}
+ </Article>
</div>
);
};