angular/aio/tools/transforms/angular-api-package/processors/fixupProjectRelativePath.js
Derek Cormier 4247136226 build(bazel): fix a regression where github links were incorrectly
written

Incorrectly prepended 'packages/' to docs that were under aio/content.
2022-11-22 13:51:16 -07:00

14 lines
494 B
JavaScript

module.exports = function fixupProjectRelativePath(API_DOC_TYPES) {
return {
$runAfter: ['readTypeScriptModules'],
$runBefore: ['processing-docs'],
$process(docs) {
docs.forEach(doc => {
if (API_DOC_TYPES.indexOf(doc.docType) !== -1 && doc.fileInfo && doc.fileInfo.realFilePath) {
// this is an API doc - so fix up its real path
doc.fileInfo.projectRelativePath = 'packages/' + doc.fileInfo.projectRelativePath;
}
});
}
};
};