-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add nofollow to the Edit this page link
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Swizzle action eject is unsafe to perform on EditThisPage. | ||
// It is more likely to be affected by breaking changes in the future | ||
// https://docusaurus.io/docs/swizzling/ | ||
// | ||
// We added nofollow to the link for SEO purposes. | ||
import React from 'react'; | ||
import Translate from '@docusaurus/Translate'; | ||
import {ThemeClassNames} from '@docusaurus/theme-common'; | ||
import Link from '@docusaurus/Link'; | ||
import IconEdit from '@theme/Icon/Edit'; | ||
import type {Props} from '@theme/EditThisPage'; | ||
|
||
export default function EditThisPage({editUrl}: Props): JSX.Element { | ||
return ( | ||
<Link to={editUrl} className={ThemeClassNames.common.editThisPage} rel="nofollow noopener noreferrer"> | ||
<IconEdit /> | ||
<Translate | ||
id="theme.common.editThisPage" | ||
description="The link label to edit the current page"> | ||
Edit this page | ||
</Translate> | ||
</Link> | ||
); | ||
} |