fix: always include item field in BreadcrumbList JSON-LD

Fixes Google Search Console error: missing field "item" in itemListElement.
Also removes unused ahrefs site verification meta tag.
This commit is contained in:
Samuel Berthe 2026-04-21 16:00:30 +02:00
parent 6b2a5af9f9
commit bb8ac9b0cd
No known key found for this signature in database
GPG key ID: 64863511FFBD0E3C
2 changed files with 3 additions and 2 deletions

View file

@ -15,6 +15,8 @@ const { items, base } = Astro.props;
const allItems = [{ label: 'Home', href: `${base}/` }, ...items];
const currentUrl = Astro.url.href;
const jsonLd = {
'@context': 'https://schema.org',
'@type': 'BreadcrumbList',
@ -22,7 +24,7 @@ const jsonLd = {
'@type': 'ListItem',
position: i + 1,
name: item.label,
...(item.href ? { item: `${SITE_ORIGIN}${item.href}` } : {}),
item: item.href ? `${SITE_ORIGIN}${item.href}` : currentUrl,
})),
};
---

View file

@ -44,7 +44,6 @@ const canonical = canonicalUrl ?? `${SITE_ORIGIN}${base}${Astro.url.pathname.rep
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#E6522C" />
<meta name="author" content={AUTHOR_NAME} />
<meta name="ahrefs-site-verification" content="da5bb74a487d1869ab3a7854e35e12f247bad1cb52116ede21ad9d01e26d1c68">
{noIndex && <meta name="robots" content="noindex" />}
<SEO