Skip to content

Commit

Permalink
Add nofollow to the Edit this page link
Browse files Browse the repository at this point in the history
  • Loading branch information
ArturT committed Jan 16, 2025
1 parent 7c5259e commit e8a787d
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions docusaurus/src/theme/EditThisPage/index.tsx
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>
);
}

0 comments on commit e8a787d

Please sign in to comment.