diff --git a/beta/src/components/Layout/Page.tsx b/beta/src/components/Layout/Page.tsx index ecb6cc903da..6b13d300b4a 100644 --- a/beta/src/components/Layout/Page.tsx +++ b/beta/src/components/Layout/Page.tsx @@ -18,9 +18,15 @@ import sidebarLearn from '../../sidebarLearn.json'; import sidebarReference from '../../sidebarReference.json'; import type {TocItem} from 'components/MDX/TocContext'; import type {RouteItem} from 'components/Layout/getRouteMeta'; +import {ExternalLink} from 'components/ExternalLink'; +import {siteConfig} from 'siteConfig'; import(/* webpackPrefetch: true */ '../MDX/CodeBlock/CodeBlock'); +function getGithubEditUrl(path: string): string { + return `${siteConfig.editUrl}/../content${path}.md`; +} + interface PageProps { children: React.ReactNode; toc: Array; @@ -76,6 +82,26 @@ export function Page({children, toc, routeTree, meta, section}: PageProps) { nextRoute={nextRoute} prevRoute={prevRoute} /> +
+ + + + + Edit on Github + +
diff --git a/beta/src/siteConfig.ts b/beta/src/siteConfig.ts index f82b2ddc6af..96ec516feec 100644 --- a/beta/src/siteConfig.ts +++ b/beta/src/siteConfig.ts @@ -3,7 +3,7 @@ */ export const siteConfig = { - editUrl: 'https://github.com/reactjs/reactjs.org/edit/beta/src/pages', + editUrl: 'https://github.com/reactjs/reactjs.org/edit/main/beta/src/pages', copyright: `Copyright © ${new Date().getFullYear()} Facebook Inc. All Rights Reserved.`, repoUrl: 'https://github.com/facebook/react', twitterUrl: 'https://twitter.com/reactjs',