Skip to content

Commit 6a70093

Browse files
author
Simon Prickett
committed
Changes to make the edit page functionality configurable.
1 parent 7a1257c commit 6a70093

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

docs/get-involved/hacktoberfest/index-hacktoberfest.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ title: Hacktoberfest 2021 at Redis
44
sidebar_label: Hacktoberfest 2021
55
slug: /hacktoberfest/
66
authors: [suze,simon]
7+
isEditable: false
78
---
89

910

src/theme/DocItem/index.tsx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -119,17 +119,19 @@ function DocItem(props: Props): JSX.Element {
119119
{(editUrl || lastUpdatedAt || lastUpdatedBy) && (
120120
<div className="margin-vert--xl">
121121
<div className="row">
122-
<div className="col">
123-
{editUrl && (
124-
<a
125-
href={editUrl}
126-
target="_blank"
127-
rel="noreferrer noopener">
128-
<IconEdit />
129-
Edit this page
130-
</a>
131-
)}
132-
</div>
122+
{(! DocContent.frontMatter.hasOwnProperty('isEditable') || DocContent.frontMatter.isEditable === true) && (
123+
<div className="col">
124+
{editUrl && (
125+
<a
126+
href={editUrl}
127+
target="_blank"
128+
rel="noreferrer noopener">
129+
<IconEdit />
130+
Edit this page
131+
</a>
132+
)}
133+
</div>
134+
)}
133135
{(lastUpdatedAt || lastUpdatedBy) && (
134136
<div className="col text--right">
135137
<em>

0 commit comments

Comments
 (0)