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

Commit

Permalink
use static branch for github edit button (via #138)
Browse files Browse the repository at this point in the history
  • Loading branch information
Artem Eroshenko authored Sep 7, 2021
1 parent b5f6d43 commit 79aecbf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ features:
editOnRepo:
location: https://github.com/allure-framework/allure-docs
type: github
branch: master
editable: true
mermaid:
language: "mermaid"
Expand Down
1 change: 1 addition & 0 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ module.exports = {
description: config.metadata.description,
docsLocation: config.features.editOnRepo.location,
docsLocationType: config.features.editOnRepo.type,
docsLocationBranch: config.features.editOnRepo.branch,
editable: config.features.editOnRepo.editable,
siteImage: config.metadata.siteImage,
favicon: config.metadata.favicon,
Expand Down
6 changes: 3 additions & 3 deletions src/templates/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,8 @@ export default class MDXRuntimeTest extends React.Component {
const {
mdx,
site: {
siteMetadata: { docsLocation, docsLocationType, editable },
siteMetadata: { docsLocation, docsLocationType, docsLocationBranch, editable },
},
gitBranch,
} = data;

// meta tags
Expand All @@ -135,7 +134,7 @@ export default class MDXRuntimeTest extends React.Component {
{docsLocation && ((editable && mdx.frontmatter.editable !== false) || mdx.frontmatter.editable === true) ? (
<EditOnRepo
location={docsLocation}
branch={gitBranch.name}
branch={docsLocationBranch}
path={mdx.parent.relativePath}
repoType={docsLocationType}
/>
Expand Down Expand Up @@ -185,6 +184,7 @@ export const pageQuery = graphql`
title
docsLocation
docsLocationType
docsLocationBranch
editable
}
}
Expand Down

0 comments on commit 79aecbf

Please sign in to comment.