From 6b985b5c5d6f086d4a00e73be13b98c098289c98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kre=C5=A1imir=20=C4=8Coko?= Date: Thu, 17 Sep 2020 09:18:43 +0200 Subject: [PATCH] fix(clayui.com): Use mainTabURl instead of string checking --- clayui.com/gatsby/onCreateNode.js | 5 +---- clayui.com/src/templates/docs.js | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/clayui.com/gatsby/onCreateNode.js b/clayui.com/gatsby/onCreateNode.js index e289c6164d..83ec8a3d65 100644 --- a/clayui.com/gatsby/onCreateNode.js +++ b/clayui.com/gatsby/onCreateNode.js @@ -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`; diff --git a/clayui.com/src/templates/docs.js b/clayui.com/src/templates/docs.js index 832af27f88..e3144c4dff 100644 --- a/clayui.com/src/templates/docs.js +++ b/clayui.com/src/templates/docs.js @@ -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),