fix: 在搜索标题中显示中文内容
This commit is contained in:
parent
73bb7b552f
commit
3977fb897d
|
@ -23,6 +23,7 @@ module.exports = function h1CheckerPostProcessor() {
|
|||
if (file.headings.h1.length > 2) {
|
||||
file.fail(`More than two h1 found in ${file}`);
|
||||
} else if (file.headings.h1.length > 1) {
|
||||
file.titleCn = file.headings.h1[0];
|
||||
file.title = file.headings.h1[1];
|
||||
} else if (file.headings.h1.length === 1) {
|
||||
file.title = file.headings.h1[0];
|
||||
|
|
|
@ -84,7 +84,7 @@ module.exports = function generateKeywordsProcessor(log, readFilesProcessor) {
|
|||
}
|
||||
|
||||
// Extract the title to use in searches
|
||||
doc.searchTitle = doc.searchTitle || doc.title || doc.vFile && doc.vFile.title || doc.name || '';
|
||||
doc.searchTitle = doc.searchTitle || doc.title || doc.vFile && (doc.vFile.titleCn || doc.vFile.title) || doc.name || '';
|
||||
|
||||
// Attach all this search data to the document
|
||||
doc.searchTerms = {
|
||||
|
|
Loading…
Reference in New Issue