Skip to content

Commit

Permalink
Add canoncial links for the changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
HazAT committed Feb 22, 2024
1 parent dc72070 commit e0b7966
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/changelog/%5Fadmin/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import {type ReactNode, Suspense} from 'react';
import {GET} from 'app/changelog/api/auth/[...nextauth]/route';
import type {Metadata} from 'next';
import {getServerSession} from 'next-auth/next';

import LoginButton from 'sentry-docs/components/changelog/loginButton';
import NextAuthSessionProvider from 'sentry-docs/components/nextAuthSessionProvider';

export const metadata: Metadata = {
robots: 'noindex, nofollow',
};

export default async function Layout({children}: {children: ReactNode}) {
const session = await getServerSession(GET);
let content = (
Expand Down
3 changes: 3 additions & 0 deletions app/changelog/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ export async function generateMetadata(
return {
title: changelog?.title,
description: changelog?.summary,
alternates: {
canonical: `https://sentry.io/changelog/${params.slug}`,
},
openGraph: {
images: changelog?.image || (await parent).openGraph?.images,
},
Expand Down
1 change: 1 addition & 0 deletions app/changelog/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const rubik = Rubik({

export const metadata: Metadata = {
title: {template: '%s | Sentry Changelog', default: 'Changelog'},
metadataBase: new URL('https://sentry.io/changelog/'),
};

export default function ChangelogLayout({children}: {children: ReactNode}) {
Expand Down
3 changes: 3 additions & 0 deletions app/changelog/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ export function generateMetadata(): Metadata {
return {
description:
'Stay up to date on everything big and small, from product updates to SDK changes with the Sentry Changelog.',
alternates: {
canonical: `https://sentry.io/changelog/`,
},
other: {
'sentry-trace': `${Sentry.getActiveSpan()?.toTraceparent()}`,
},
Expand Down

0 comments on commit e0b7966

Please sign in to comment.