mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-21 01:53:26 +00:00
Fix canonical in a safe way (#2589)
This commit is contained in:
@@ -150,7 +150,8 @@ export async function generateMetadata({
|
||||
.join(' | '),
|
||||
description: page.description ?? '',
|
||||
alternates: {
|
||||
canonical: absoluteHref(getPagePath(pages, page), true),
|
||||
// Trim trailing slashes in canonical URL to match the redirect behavior
|
||||
canonical: absoluteHref(getPagePath(pages, page), true).replace(/\/+$/, ''),
|
||||
},
|
||||
openGraph: {
|
||||
images: [
|
||||
|
||||
Reference in New Issue
Block a user