|
@@ -124,9 +124,10 @@
|
|
|
let inputVal = $('#blog_search').val();
|
|
|
matchContent = "";
|
|
|
contentsData.map(item => {
|
|
|
- // 搜尋特定分類的文章
|
|
|
- if (item.categories) {
|
|
|
- if (item.categories.includes(category)) {
|
|
|
+ // 搜尋特定分類文章
|
|
|
+ // if (item.categories) {
|
|
|
+ // if (item.categories.includes(category)) {
|
|
|
+ // 搜尋所有分類文章
|
|
|
if (item.title.includes(inputVal) || item.description.includes(inputVal) || item.content.includes(inputVal)) {
|
|
|
matchContent += `
|
|
|
<div class="article-item">
|
|
@@ -144,8 +145,8 @@
|
|
|
</div>
|
|
|
</div>`
|
|
|
}
|
|
|
- }
|
|
|
- }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
})
|
|
|
document.getElementById("articleList").innerHTML = matchContent;
|
|
|
});
|