Skip to content

Commit

Permalink
fix(clayui.com): Use mainTabURl instead of string checking
Browse files Browse the repository at this point in the history
  • Loading branch information
kresimir-coko committed Sep 17, 2020
1 parent c4e97b2 commit 6b985b5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions clayui.com/gatsby/onCreateNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,7 @@ module.exports = exports.onCreateNode = ({actions, getNode, node}) => {
'@clayui/',
''
)}.html`;
} else if (
!relativePath.includes('api-') ||
!relativePath.includes('markup-')
) {
} else if (mainTabURL) {
slug = `docs/components/${fileName
.replace('_', '-')
.toLowerCase()}.html`;
Expand Down
2 changes: 1 addition & 1 deletion clayui.com/src/templates/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export default (props) => {

const {allMarkdownRemark, allMdx, mainTab, pageMd, pageMdx} = data;

const hasMainTab = !!mainTab.frontmatter.title;
const hasMainTab = mainTab ? !!mainTab.frontmatter.title : false;

const {body, excerpt, fields, frontmatter, html, timeToRead} = {
...(pageMdx || pageMd),
Expand Down

0 comments on commit 6b985b5

Please sign in to comment.