mirror of
https://github.com/noodlapp/noodl-docs.git
synced 2026-01-11 06:42:55 +01:00
fix: SEO-1 (#29)
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
const { recursiveBuildSidebarData } = require('./dataHelpers');
|
||||
|
||||
const NodeType = {
|
||||
Visual: 'is-visual',
|
||||
Data: 'is-data',
|
||||
@@ -658,7 +656,7 @@ function recursiveBuildNodeOverviewData(item) {
|
||||
} else {
|
||||
return {
|
||||
label: item.label,
|
||||
docUrl: item.id,
|
||||
docUrl: '/nodes/' + item.id,
|
||||
nodeType: item.nodeType,
|
||||
key: item.label,
|
||||
};
|
||||
@@ -679,6 +677,23 @@ exports.getNodePageData = function () {
|
||||
});
|
||||
};
|
||||
|
||||
function recursiveBuildSidebarData(item) {
|
||||
if ('items' in item) {
|
||||
// is a category
|
||||
return {
|
||||
type: 'category',
|
||||
label: item.label,
|
||||
items: item.items.map(recursiveBuildSidebarData),
|
||||
}
|
||||
} else {
|
||||
return {
|
||||
type: 'doc',
|
||||
label: item.label,
|
||||
id: item.id + "/README",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
exports.getNodeSidebarData = function () {
|
||||
return nodeData.map(recursiveBuildSidebarData);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user