Skip to content

Commit

Permalink
Enable Suggest Edits button
Browse files Browse the repository at this point in the history
  • Loading branch information
ppcano committed Apr 17, 2020
1 parent 642ffbd commit cfa1802
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 21 deletions.
6 changes: 1 addition & 5 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,4 @@ GATSBY_ALGOLIA_APP_ID=
GATSBY_ALGOLIA_SEARCH_ONLY_KEY=
GATSBY_ALGOLIA_INDEX_NAME=
ALGOLIA_ADMIN_KEY=
GATSBY_DRIFT_API=

# leave empty to disable
# true to enable
GATSBY_FEATURE_EDIT_ARTICLE_BTN=
GATSBY_DRIFT_API=
4 changes: 0 additions & 4 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,6 @@ async function createDocPages({ graphql, actions, pathPrefix }) {
)(path);

// injection of a link to an article in git repo
// NOTE, that this is part of feature/edit-article-btn
// so it won't be used unless you have
// GATSBY_FEATURE_EDIT_ARTICLE_BTN=true
// in your .env file
remarkNode.frontmatter.fileOrigin = encodeURI(
`https://github.com/loadimpact/k6-docs/blob/master/src/data/${relativeDirectory}/${name}.md`,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,13 @@ import Pencil from './svg/pencil-icon.inline.svg';
import { Heading } from 'components/shared/heading';

export const DocPageTitleGroup = ({ title, articleSrc }) => {
if (process.env.GATSBY_FEATURE_EDIT_ARTICLE_BTN) {
console.log(typeof process.env.GATSBY_FEATURE_EDIT_ARTICLE_BTN);
return (
<div className={styles.wrapper}>
<Heading className={styles.title}>{title}</Heading>
<a className={styles.editLink} href={articleSrc} target={'_blank'}>
<Pencil />
suggest edits
</a>
</div>
);
}
return (
<div className={styles.wrapper}>
<Heading className={styles.title}>{title}</Heading>
<a className={styles.editLink} href={articleSrc} target={'_blank'}>
<Pencil />
suggest edits
</a>
</div>
);
};

0 comments on commit cfa1802

Please sign in to comment.