From 6a7009387e30e03be4769870046bf4bbfa30f67c Mon Sep 17 00:00:00 2001 From: Simon Prickett Date: Thu, 28 Oct 2021 16:39:56 +0100 Subject: [PATCH] Changes to make the edit page functionality configurable. --- .../hacktoberfest/index-hacktoberfest.mdx | 1 + src/theme/DocItem/index.tsx | 24 ++++++++++--------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/docs/get-involved/hacktoberfest/index-hacktoberfest.mdx b/docs/get-involved/hacktoberfest/index-hacktoberfest.mdx index 998109f2d3..971b9a8289 100644 --- a/docs/get-involved/hacktoberfest/index-hacktoberfest.mdx +++ b/docs/get-involved/hacktoberfest/index-hacktoberfest.mdx @@ -4,6 +4,7 @@ title: Hacktoberfest 2021 at Redis sidebar_label: Hacktoberfest 2021 slug: /hacktoberfest/ authors: [suze,simon] +isEditable: false --- diff --git a/src/theme/DocItem/index.tsx b/src/theme/DocItem/index.tsx index 1356d93cea..28d9774b8e 100644 --- a/src/theme/DocItem/index.tsx +++ b/src/theme/DocItem/index.tsx @@ -119,17 +119,19 @@ function DocItem(props: Props): JSX.Element { {(editUrl || lastUpdatedAt || lastUpdatedBy) && (
-
- {editUrl && ( - - - Edit this page - - )} -
+ {(! DocContent.frontMatter.hasOwnProperty('isEditable') || DocContent.frontMatter.isEditable === true) && ( +
+ {editUrl && ( + + + Edit this page + + )} +
+ )} {(lastUpdatedAt || lastUpdatedBy) && (