diff --git a/lib/helpers/navigation-helper.js b/lib/helpers/navigation-helper.js index 0c4e36cacd..75f6525922 100644 --- a/lib/helpers/navigation-helper.js +++ b/lib/helpers/navigation-helper.js @@ -1,8 +1,8 @@ import { orderBy } from 'lodash'; -export function navigationHelper({ pages, ignorePaths }) { - if (ignorePaths) { - pages = pages.filter(page => !ignorePaths.includes(page.path)); +export function navigationHelper({ pages, ignoreURLs }) { + if (ignoreURLs) { + pages = pages.filter(page => !ignoreURLs.includes(page.url)); } pages = orderBy(pages, 'sortOrder'); diff --git a/lib/helpers/sub-navigation-helper.js b/lib/helpers/sub-navigation-helper.js index 65cc9912e9..2e84754d6f 100644 --- a/lib/helpers/sub-navigation-helper.js +++ b/lib/helpers/sub-navigation-helper.js @@ -10,10 +10,10 @@ export function subNavigationHelper({ pageInfo, anchorLinks }) { const groups = []; if (anchorLinks) { - const path = `${sourcePath}${pageInfo.path}/index.njk`; + const path = `${sourcePath}${pageInfo.url}/index.njk`; if (fs.existsSync(path)) { - const item = items.find(item => item.path === pageInfo.path); + const item = items.find(item => item.url === pageInfo.url); const raw = fs.readFileSync(path, 'utf8'); const matches = raw @@ -29,7 +29,7 @@ export function subNavigationHelper({ pageInfo, anchorLinks }) { const anchors = matches.map(match => ({ title: match, - path: `#${match + url: `#${match .trim() .toLowerCase() .replace(/\s/g, '-')}` diff --git a/lib/nunjucks-html-loader.js b/lib/nunjucks-html-loader.js index 1b5649d75c..12cc8e266e 100644 --- a/lib/nunjucks-html-loader.js +++ b/lib/nunjucks-html-loader.js @@ -66,10 +66,10 @@ function buildSiteMap(context) { title, sortOrder, group, - path: path.replace('/index.njk', '').replace('.njk', '') || '/' + url: path.replace('/index.njk', '').replace('.njk', '') || '/' }); } else { - const newRef = ref.find(page => page.path === `/${part}`); + const newRef = ref.find(page => page.url === `/${part}`); if (newRef) { if (!newRef.children) { @@ -118,7 +118,7 @@ function getPageInfo(context) { } if (Array.isArray(pageRef)) { - pageRef = pageRef.find(page => page.path === pathRef); + pageRef = pageRef.find(page => page.url === pathRef); } } }); @@ -129,9 +129,9 @@ function getPageInfo(context) { path = path.replace('/index.njk', '').replace('.njk', '') || '/'; - return { path, siteMap, children, parent, title }; + return { url: path, siteMap, children, parent, title }; } else { - return { path }; + return { url: path }; } } @@ -166,7 +166,7 @@ export default async function(source) { const options = loaderUtils.getOptions(this) || {}; const pageInfo = getPageInfo(this); const frontmatterData = frontmatter(source).data; - const isExample = pageInfo.path.includes('/examples/'); + const isExample = pageInfo.url.includes('/examples/'); // Remove frontmatter from source source = removeFrontmatterFromString(source); diff --git a/src/components/header/_macro.njk b/src/components/header/_macro.njk index 0f4f5688ab..f8da4586ed 100644 --- a/src/components/header/_macro.njk +++ b/src/components/header/_macro.njk @@ -33,7 +33,7 @@