From 9e983f7cf3c43c11eed44154786c83ae3c976ff3 Mon Sep 17 00:00:00 2001 From: Roman Grinovski Date: Wed, 20 Sep 2023 11:48:22 +0200 Subject: [PATCH 1/3] add editUrl to docs --- docusaurus.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/docusaurus.config.js b/docusaurus.config.js index 95236715..ac2b0505 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -84,6 +84,7 @@ const config = { docs: { sidebarPath: require.resolve("./sidebars.js"), routeBasePath: "/docs", + editUrl: "https://github.com/opentofu/opentofu/tree/main/website", }, blog: false, gtag: { From bf67d7901435bdc1e85be0c3656b03a3b535c785 Mon Sep 17 00:00:00 2001 From: Roman Grinovski Date: Wed, 20 Sep 2023 11:51:54 +0200 Subject: [PATCH 2/3] change link to actual editing link --- docusaurus.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docusaurus.config.js b/docusaurus.config.js index ac2b0505..9a1cc9ed 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -84,7 +84,7 @@ const config = { docs: { sidebarPath: require.resolve("./sidebars.js"), routeBasePath: "/docs", - editUrl: "https://github.com/opentofu/opentofu/tree/main/website", + editUrl: "https://github.com/opentofu/opentofu/edit/main/website", }, blog: false, gtag: { From aa29c6e837e8144b3e99fdde165a5cc84f90c73f Mon Sep 17 00:00:00 2001 From: Roman Grinovski Date: Wed, 20 Sep 2023 12:51:08 +0200 Subject: [PATCH 3/3] swizzle EditThisPage component --- src/theme/EditThisPage/index.tsx | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/theme/EditThisPage/index.tsx diff --git a/src/theme/EditThisPage/index.tsx b/src/theme/EditThisPage/index.tsx new file mode 100644 index 00000000..9c7fad6c --- /dev/null +++ b/src/theme/EditThisPage/index.tsx @@ -0,0 +1,22 @@ +import React from "react"; +import Translate from "@docusaurus/Translate"; +import { ThemeClassNames } from "@docusaurus/theme-common"; +import IconEdit from "@theme/Icon/Edit"; +export default function EditThisPage({ editUrl }) { + return ( + + + + Edit this page + + + ); +}