Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Commit 79aecbf

Browse files
author
Artem Eroshenko
authored
use static branch for github edit button (via #138)
1 parent b5f6d43 commit 79aecbf

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

config/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ features:
5858
editOnRepo:
5959
location: https://github.com/allure-framework/allure-docs
6060
type: github
61+
branch: master
6162
editable: true
6263
mermaid:
6364
language: "mermaid"

gatsby-config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ module.exports = {
264264
description: config.metadata.description,
265265
docsLocation: config.features.editOnRepo.location,
266266
docsLocationType: config.features.editOnRepo.type,
267+
docsLocationBranch: config.features.editOnRepo.branch,
267268
editable: config.features.editOnRepo.editable,
268269
siteImage: config.metadata.siteImage,
269270
favicon: config.metadata.favicon,

src/templates/docs.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,8 @@ export default class MDXRuntimeTest extends React.Component {
117117
const {
118118
mdx,
119119
site: {
120-
siteMetadata: { docsLocation, docsLocationType, editable },
120+
siteMetadata: { docsLocation, docsLocationType, docsLocationBranch, editable },
121121
},
122-
gitBranch,
123122
} = data;
124123

125124
// meta tags
@@ -135,7 +134,7 @@ export default class MDXRuntimeTest extends React.Component {
135134
{docsLocation && ((editable && mdx.frontmatter.editable !== false) || mdx.frontmatter.editable === true) ? (
136135
<EditOnRepo
137136
location={docsLocation}
138-
branch={gitBranch.name}
137+
branch={docsLocationBranch}
139138
path={mdx.parent.relativePath}
140139
repoType={docsLocationType}
141140
/>
@@ -185,6 +184,7 @@ export const pageQuery = graphql`
185184
title
186185
docsLocation
187186
docsLocationType
187+
docsLocationBranch
188188
editable
189189
}
190190
}

0 commit comments

Comments
 (0)