fix(aio): convert API and content docs to JSON
This commit is contained in:

committed by
Igor Minar

parent
5e9474d24c
commit
dfed388139
@ -0,0 +1,20 @@
|
||||
module.exports = function convertToJsonProcessor() {
|
||||
|
||||
return {
|
||||
$runAfter: ['checkUnbalancedBackTicks'],
|
||||
$runBefore: ['writeFilesProcessor'],
|
||||
docTypes: [],
|
||||
$process: function(docs) {
|
||||
const docTypes = this.docTypes
|
||||
docs.forEach((doc) => {
|
||||
if (docTypes.indexOf(doc.docType) !== -1) {
|
||||
const output = {
|
||||
title: doc.title || doc.name,
|
||||
content: doc.renderedContent
|
||||
};
|
||||
doc.renderedContent = JSON.stringify(output, null, 2);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
};
|
@ -102,7 +102,7 @@ module.exports = function generateKeywordsProcessor(log, readFilesProcessor) {
|
||||
|
||||
|
||||
doc.searchTerms = {
|
||||
titleWords: extractTitleWords(doc.name),
|
||||
titleWords: extractTitleWords(doc.title || doc.name),
|
||||
keywords: words.sort().join(' '),
|
||||
members: members.sort().join(' ')
|
||||
};
|
||||
|
Reference in New Issue
Block a user