Skip to content

Commit b9edc4e

Browse files
author
Xavier Agostini
authored
Xav/qa docs (#291)
* fix feedback link * rerun catalog and side-nav * rerun catalog and side-nav * add connection modes * fix segment-app images * move segment app images * fix side-nav external link * update catalog to add extra destination info and fix integration footer * update nav generation to remove hidden files from nav
1 parent d2ce818 commit b9edc4e

File tree

7 files changed

+2918
-2951
lines changed

7 files changed

+2918
-2951
lines changed

scripts/catalog.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,9 @@ const updateDestinations = async () => {
219219
browserUnbundlingSupported: destination.browserUnbundlingSupported,
220220
browserUnbundlingPublic: destination.browserUnbundlingPublic
221221
})
222-
222+
223223
let url = `connections/destinations/catalog/${slug}`
224+
224225
let updatedDestination = {
225226
display_name: destination.display_name,
226227
slug,
@@ -244,6 +245,7 @@ const updateDestinations = async () => {
244245
}
245246
destinationsUpdated.push(updatedDestination)
246247
doesCatalogItemExist(updatedDestination)
248+
247249
// add unique destination categories to set
248250
tempCategories.reduce((s, e) => s.add(e), categories);
249251
})

scripts/nav.js

+10-8
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const getSection = (accum, paths) => {
2525

2626
return subsection;
2727
};
28-
28+
2929
const files = glob.sync('**/*.md', { ignore, cwd: path.resolve(__dirname, '../src') });
3030

3131
const sections = files.reduce((accum, file) => {
@@ -40,15 +40,17 @@ const sections = files.reduce((accum, file) => {
4040
// read in the .md file, parse the frontmatter attributes
4141
const f = fm(fs.readFileSync(path.resolve(__dirname, '../src', file), 'utf8'));
4242

43-
const title = f.attributes.title || getTitle(paths[paths.length - 1].slice(0, -3));
44-
const s = getSection(accum, paths.slice(0, -1));
43+
// if file has hidden attribute don't add to nav
44+
if (!f.attributes.hidden) {
45+
const title = f.attributes.title || getTitle(paths[paths.length - 1].slice(0, -3));
46+
const s = getSection(accum, paths.slice(0, -1));
4547

46-
if (paths[paths.length - 1] === 'index.md') {
47-
s.section.unshift({ path: `/${paths.slice(0, -1).join('/')}`, title });
48-
} else {
49-
s.section.push({ path: `/${paths.join('/').slice(0, -3)}`, title });
48+
if (paths[paths.length - 1] === 'index.md') {
49+
s.section.unshift({ path: `/${paths.slice(0, -1).join('/')}`, title });
50+
} else {
51+
s.section.push({ path: `/${paths.join('/').slice(0, -3)}`, title });
52+
}
5053
}
51-
5254
return accum;
5355
}, {});
5456

0 commit comments

Comments
 (0)