Add link rel="canonical"

This commit is contained in:
Vanilagy
2026-04-29 17:00:59 +02:00
parent a61631a299
commit 9224fb886c
8 changed files with 11 additions and 0 deletions
+4
View File
@@ -196,10 +196,14 @@ export default withMermaid({
if (title !== 'Mediabunny') {
title += ' | Mediabunny';
}
const canonicalUrl = `https://mediabunny.dev/${pageData.relativePath}`
.replace(/index\.md$/, '')
.replace(/\.md$/, '');
((pageData.frontmatter['head'] ??= []) as HeadConfig[]).push(
['meta', { property: 'og:title', content: title }],
['meta', { property: 'twitter:title', content: title }],
['link', { rel: 'canonical', href: canonicalUrl }],
);
},
});