fix: Always strip trailing slash on canonical links

This commit is contained in:
Tom Moor
2022-06-06 22:04:12 +02:00
parent e5b524e4c2
commit 14b9259a47
2 changed files with 5 additions and 2 deletions

View File

@@ -119,7 +119,10 @@ function SharedDocumentScene(props: Props) {
return (
<>
<Helmet>
<link rel="canonical" href={canonicalOrigin + location.pathname} />
<link
rel="canonical"
href={canonicalOrigin + location.pathname.replace(/\/$/, "")}
/>
</Helmet>
<Layout title={response.document.title} sidebar={sidebar}>
<Document

View File

@@ -56,7 +56,7 @@ const renderApp = async (
const {
title = "Outline",
description = "A modern team knowledge base for your internal documentation, product specs, support answers, meeting notes, onboarding, &amp; more…",
canonical = ctx.request.href,
canonical = "",
} = options;
if (ctx.request.path === "/realtime/") {