Skip to content

Commit ecd15bb

Browse files
author
Simon Prickett
authored
Merge pull request #133 from redis-developer/feature/configurable-edit-page
Make the "Edit this page" link configurable (on/off)
2 parents ad5232c + 5526008 commit ecd15bb

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: Start Here
55
slug: /hacktoberfest/
66
authors: [suze,simon]
7+
isEditable: false
78
useNextPrev: false
89
---
910

src/theme/DocItem/index.tsx

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

0 commit comments

Comments
 (0)