feat(aio): revise Docs page; docs version selector in sidenav

This commit is contained in:
Ward Bell
2017-04-25 14:48:01 -07:00
committed by Pete Bacon Darwin
parent de25cfc0cb
commit 4be1966a21
16 changed files with 245 additions and 195 deletions

View File

@ -34,13 +34,15 @@ function walk(node, map, path) {
let errors = [];
for(const key in node) {
const child = node[key];
if (key === 'url') {
const url = child.replace(/#.*$/, ''); // strip hash
if (isRelative(url) && !map[url]) {
errors.push({ path: path.join('.'), url });
if (child !== null) { // null is allowed
if (key === 'url') {
const url = child.replace(/#.*$/, ''); // strip hash
if (isRelative(url) && !map[url]) {
errors.push({ path: path.join('.'), url });
}
} else if (typeof child !== 'string') {
errors = errors.concat(walk(child, map, path.concat([key])));
}
} else if (typeof child !== 'string') {
errors = errors.concat(walk(child, map, path.concat([key])));
}
}
return errors;