build(docs-infra): include packages in API template breadcrumbs (#25453)
PR Close #25453
This commit is contained in:

committed by
Ben Lesh

parent
1c86e9b3b2
commit
bf441e8b9e
@ -8,11 +8,27 @@ module.exports = function computeApiBreadCrumbs(API_DOC_TYPES_TO_RENDER) {
|
||||
if (API_DOC_TYPES_TO_RENDER.indexOf(doc.docType) !== -1) {
|
||||
doc.breadCrumbs = [];
|
||||
doc.breadCrumbs.push({ text: 'API', path: '/api' });
|
||||
if (doc.moduleDoc) doc.breadCrumbs.push({ text: '@angular/' + doc.moduleDoc.id, path: doc.moduleDoc.path });
|
||||
if (isSecondaryEntryPoint(doc)) {
|
||||
doc.breadCrumbs.push(createPackageBreadcrumb(doc));
|
||||
}
|
||||
if (doc.moduleDoc) {
|
||||
if (isSecondaryEntryPoint(doc.moduleDoc)) {
|
||||
doc.breadCrumbs.push(createPackageBreadcrumb(doc.moduleDoc));
|
||||
}
|
||||
doc.breadCrumbs.push({ text: '@angular/' + doc.moduleDoc.id, path: doc.moduleDoc.path });
|
||||
}
|
||||
doc.breadCrumbs.push({ text: doc.name, path: doc.path });
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
function isSecondaryEntryPoint(doc) {
|
||||
return doc.docType === 'package' && !doc.isPrimaryPackage;
|
||||
}
|
||||
|
||||
function createPackageBreadcrumb(doc) {
|
||||
return { text: doc.packageInfo.primary.name, path: doc.packageInfo.primary.path };
|
||||
}
|
||||
|
Reference in New Issue
Block a user