Skip to content
This repository has been archived by the owner on Jul 16, 2023. It is now read-only.

Commit

Permalink
feat(components): ✨ make previous-next buttons configurable (on/off)
Browse files Browse the repository at this point in the history
  • Loading branch information
filipowm committed Jun 4, 2020
1 parent d1fb65b commit 212ae29
Show file tree
Hide file tree
Showing 3 changed files with 11 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 @@ -66,3 +66,4 @@ features:
enabled: true
toc:
depth: 3
previousNext: true
1 change: 1 addition & 0 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ exports.createSchemaCustomization = ({ actions }) => {
skipToC: Boolean
editable: Boolean
skipMetadata: Boolean
showPreviousNext: Boolean
metaDescription: String
metaTitle: String
order: Int
Expand Down
12 changes: 9 additions & 3 deletions src/templates/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,14 @@ export default class MDXRuntimeTest extends React.Component {
<ContentWrapper>
<MDXRenderer>{mdx.body}</MDXRenderer>
</ContentWrapper>
<div css={{ padding: '50px 0' }}>
<NextPrevious mdx={mdx} />
</div>
{(config.features.previousNext === true && mdx.frontmatter.showPreviousNext != false) ||
mdx.frontmatter.showPreviousNext ? (
<div css={{ padding: '50px 0' }}>
<NextPrevious mdx={mdx} />
</div>
) : (
''
)}
</Layout>
);
}
Expand Down Expand Up @@ -207,6 +212,7 @@ export const pageQuery = graphql`
metaDescription
skipMetadata
editable
showPreviousNext
skipToC
}
}
Expand Down

0 comments on commit 212ae29

Please sign in to comment.