Skip to content

Commit e8a787d

Browse files
committed
Add nofollow to the Edit this page link
1 parent 7c5259e commit e8a787d

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Swizzle action eject is unsafe to perform on EditThisPage.
2+
// It is more likely to be affected by breaking changes in the future
3+
// https://docusaurus.io/docs/swizzling/
4+
//
5+
// We added nofollow to the link for SEO purposes.
6+
import React from 'react';
7+
import Translate from '@docusaurus/Translate';
8+
import {ThemeClassNames} from '@docusaurus/theme-common';
9+
import Link from '@docusaurus/Link';
10+
import IconEdit from '@theme/Icon/Edit';
11+
import type {Props} from '@theme/EditThisPage';
12+
13+
export default function EditThisPage({editUrl}: Props): JSX.Element {
14+
return (
15+
<Link to={editUrl} className={ThemeClassNames.common.editThisPage} rel="nofollow noopener noreferrer">
16+
<IconEdit />
17+
<Translate
18+
id="theme.common.editThisPage"
19+
description="The link label to edit the current page">
20+
Edit this page
21+
</Translate>
22+
</Link>
23+
);
24+
}

0 commit comments

Comments
 (0)