搜索忽略大小写

This commit is contained in:
tangly1024
2022-12-06 19:24:22 +08:00
parent 54e38a16be
commit 79760c5323

View File

@@ -120,7 +120,7 @@ async function filterByMemCache(allPosts, keyword) {
const tagContent = post.tags && Array.isArray(post.tags) ? post.tags.join(' ') : ''
const categoryContent = post.category && Array.isArray(post.category) ? post.category.join(' ') : ''
const articleInfo = post.title + post.summary + tagContent + categoryContent
let hit = articleInfo.indexOf(keyword) > -1
let hit = articleInfo.toLowerCase().indexOf(keyword) > -1
let indexContent = [post.summary]
if (page && page.block) {
const contentIds = Object.keys(page.block)