Skip to content

Commit d0c19f9

Browse files
committed
Add canonical URL and options for noindex and nofollow in SEO
1 parent 54201c8 commit d0c19f9

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/layouts/Layout.astro

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ interface Props {
1111
title?: string;
1212
useTitleTemplate?: boolean;
1313
description?: string;
14+
canonicalUrl?: string;
15+
index?: boolean;
16+
follow?: boolean;
1417
};
1518
}
1619
@@ -74,6 +77,9 @@ const { metadata } = Astro.props;
7477
? `%s - ${SITE_CONFIG.title}`
7578
: undefined}
7679
description={metadata?.description || SITE_CONFIG.description}
80+
canonical={metadata?.canonicalUrl || Astro.url.href}
81+
noindex={metadata?.index === false}
82+
nofollow={metadata?.follow === false}
7783
openGraph={{
7884
basic: {
7985
title: SITE_CONFIG.title,

0 commit comments

Comments
 (0)