From 95ca6878f097942ee1ccd50e9b3e7048d7627600 Mon Sep 17 00:00:00 2001 From: Jerry Date: Sun, 13 Oct 2024 21:25:10 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=81=A9=E9=85=8D=20Alogia=20Search=20?= =?UTF-8?q?5.0=20feat:=20=E6=90=9C=E7=B4=A2=E5=88=86=E9=A0=81=E5=9C=93?= =?UTF-8?q?=E8=A7=92=20feat:=20=E8=AA=AC=E8=AA=AC=E9=A0=81=E9=9D=A2=20tag?= =?UTF-8?q?=20=E5=8F=AF=E4=BB=A5=E7=88=B2=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layout/includes/page/shuoshuo.pug | 16 ++++++++++------ plugins.yml | 8 ++++---- source/css/_search/algolia.styl | 1 + source/js/search/algolia.js | 3 ++- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/layout/includes/page/shuoshuo.pug b/layout/includes/page/shuoshuo.pug index 745b0481..58467926 100644 --- a/layout/includes/page/shuoshuo.pug +++ b/layout/includes/page/shuoshuo.pug @@ -41,9 +41,12 @@ ${item.content} ` @@ -98,6 +101,7 @@ .shuoshuo-content !=markdown(i.content) .shuoshuo-footer - .shuoshuo-tags - each tag in i.tags - span.shuoshuo-tag=tag \ No newline at end of file + if i.tags + .shuoshuo-tags + each tag in i.tags + span.shuoshuo-tag=tag \ No newline at end of file diff --git a/plugins.yml b/plugins.yml index 78bfda9a..caf60e9a 100644 --- a/plugins.yml +++ b/plugins.yml @@ -8,8 +8,8 @@ activate_power_mode: version: 1.1.4 algolia_search: name: algoliasearch - file: dist/algoliasearch-lite.umd.js - version: 5.7.0 + file: dist/lite/builds/browser.umd.js + version: 5.8.1 aplayer_css: name: aplayer file: dist/APlayer.min.css @@ -111,7 +111,7 @@ instantpage: instantsearch: name: instantsearch.js file: dist/instantsearch.production.min.js - version: 4.74.2 + version: 4.75.0 katex: name: katex file: dist/katex.min.css @@ -137,7 +137,7 @@ medium_zoom: mermaid: name: mermaid file: dist/mermaid.min.js - version: 11.2.1 + version: 11.3.0 meting_js: name: butterfly-extsrc file: metingjs/dist/Meting.min.js diff --git a/source/css/_search/algolia.styl b/source/css/_search/algolia.styl index 87f36c4c..1f7f525c 100644 --- a/source/css/_search/algolia.styl +++ b/source/css/_search/algolia.styl @@ -59,6 +59,7 @@ height: 24px text-align: center line-height: 24px + addBorderRadius() .ais-Pagination-item--selected a diff --git a/source/js/search/algolia.js b/source/js/search/algolia.js index 814a00cd..8624f52f 100644 --- a/source/js/search/algolia.js +++ b/source/js/search/algolia.js @@ -85,9 +85,10 @@ window.addEventListener('load', () => { document.querySelector('#algolia-info .algolia-stats') ] + const searchClient = typeof algoliasearch === 'function' ? algoliasearch : window['algoliasearch/lite'].liteClient const search = instantsearch({ indexName, - searchClient: algoliasearch(appId, apiKey), + searchClient: searchClient(appId, apiKey), searchFunction (helper) { disableDiv.forEach(item => { item.style.display = helper.state.query ? '' : 'none'