From 000b8358034106c63fc69f4deeac8a6fb7b51f92 Mon Sep 17 00:00:00 2001 From: Eugen Rochko <eugen@zeonfederated.com> Date: Wed, 5 Jul 2023 11:25:27 +0200 Subject: [PATCH] Add canonical link tags in web UI (#25715) --- app/javascript/mastodon/features/account/components/header.jsx | 1 + app/javascript/mastodon/features/status/index.jsx | 1 + 2 files changed, 2 insertions(+) diff --git a/app/javascript/mastodon/features/account/components/header.jsx b/app/javascript/mastodon/features/account/components/header.jsx index 5eea1abf0..b718e860d 100644 --- a/app/javascript/mastodon/features/account/components/header.jsx +++ b/app/javascript/mastodon/features/account/components/header.jsx @@ -476,6 +476,7 @@ class Header extends ImmutablePureComponent { <Helmet> <title>{titleFromAccount(account)}</title> <meta name='robots' content={(isLocal && isIndexable) ? 'all' : 'noindex'} /> + <link rel='canonical' href={account.get('url')} /> </Helmet> </div> ); diff --git a/app/javascript/mastodon/features/status/index.jsx b/app/javascript/mastodon/features/status/index.jsx index 892cfbb7b..e5faba083 100644 --- a/app/javascript/mastodon/features/status/index.jsx +++ b/app/javascript/mastodon/features/status/index.jsx @@ -713,6 +713,7 @@ class Status extends ImmutablePureComponent { <Helmet> <title>{titleFromStatus(intl, status)}</title> <meta name='robots' content={(isLocal && isIndexable) ? 'all' : 'noindex'} /> + <link rel='canonical' href={status.get('url')} /> </Helmet> </Column> );