From 0834720d32b23eda560a9eb9299b043e3999c13f Mon Sep 17 00:00:00 2001 From: Jerry Date: Sat, 8 Apr 2023 21:02:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layout/includes/head/config.pug | 2 +- plugins.yml | 30 +++++++++++++++++------------- source/js/utils.js | 11 ++++++----- 3 files changed, 24 insertions(+), 19 deletions(-) diff --git a/layout/includes/head/config.pug b/layout/includes/head/config.pug index 16eab2f..19d1007 100644 --- a/layout/includes/head/config.pug +++ b/layout/includes/head/config.pug @@ -105,7 +105,7 @@ script. post: !{theme.post_meta.post.date_format === 'relative'} }, runtime: '!{theme.runtimeshow.enable ? _p("aside.card_webinfo.runtime.unit") : ""}', - date_suffix: { + dateSuffix: { just: '!{_p("date_suffix.just")}', min: '!{_p("date_suffix.min")}', hour: '!{_p("date_suffix.hour")}', diff --git a/plugins.yml b/plugins.yml index 648077e..48567be 100644 --- a/plugins.yml +++ b/plugins.yml @@ -1,11 +1,11 @@ algolia_search: name: algoliasearch file: dist/algoliasearch-lite.umd.js - version: 4.15.0 + version: 4.16.0 instantsearch: name: instantsearch.js file: dist/instantsearch.production.min.js - version: 4.52.0 + version: 4.53.0 pjax: name: pjax file: pjax.min.js @@ -37,17 +37,17 @@ disqusjs_css: twikoo: name: twikoo file: dist/twikoo.all.min.js - version: 1.6.10 + version: 1.6.11 waline_js: name: '@waline/client' file: dist/waline.js other_name: waline - version: 2.14.8 + version: 2.14.9 waline_css: name: '@waline/client' file: dist/waline.css other_name: waline - version: 2.14.8 + version: 2.14.9 sharejs: name: butterfly-extsrc file: sharejs/dist/js/social-share.min.js @@ -109,11 +109,11 @@ lazyload: instantpage: name: instant.page file: instantpage.js - version: 5.1.1 + version: 5.2.0 typed: name: typed.js - file: lib/typed.min.js - version: 2.0.12 + file: dist/typed.umd.js + version: 2.0.15 pangu: name: pangu file: dist/browser/pangu.min.js @@ -121,12 +121,12 @@ pangu: fancybox_css: name: '@fancyapps/ui' file: dist/fancybox/fancybox.css - version: 5.0.7 + version: 5.0.14 other_name: fancyapps-ui fancybox: name: '@fancyapps/ui' file: dist/fancybox/fancybox.umd.js - version: 5.0.7 + version: 5.0.14 other_name: fancyapps-ui medium_zoom: name: medium-zoom @@ -144,7 +144,7 @@ fontawesome: name: '@fortawesome/fontawesome-free' file: css/all.min.css other_name: font-awesome - version: 6.3.0 + version: 6.4.0 flickr_justified_gallery_js: name: flickr-justified-gallery file: dist/fjGallery.min.js @@ -183,11 +183,11 @@ prismjs_autoloader: artalk_js: name: artalk file: dist/Artalk.js - version: 2.5.0 + version: 2.5.2 artalk_css: name: artalk file: dist/Artalk.css - version: 2.5.0 + version: 2.5.2 pace_js: name: pace-js other_name: pace @@ -208,3 +208,7 @@ docsearch_css: other_name: docsearch-css file: dist/style.css version: 3.3.3 +abcjs_basic_js: + name: abcjs + file: dist/abcjs-basic-min.js + version: 6.2.0 diff --git a/source/js/utils.js b/source/js/utils.js index 3debebf..b5df288 100644 --- a/source/js/utils.js +++ b/source/js/utils.js @@ -79,6 +79,7 @@ const btf = { const hour = minute * 60 const day = hour * 24 const month = day * 30 + const { dateSuffix } = GLOBAL_CONFIG if (!more) return parseInt(dateDiff / day) @@ -88,11 +89,11 @@ const btf = { const minuteCount = dateDiff / minute if (monthCount > 12) return datePost.toISOString().slice(0, 10) - if (monthCount >= 1) return parseInt(monthCount) + ' ' + GLOBAL_CONFIG.date_suffix.month - if (dayCount >= 1) return parseInt(dayCount) + ' ' + GLOBAL_CONFIG.date_suffix.day - if (hourCount >= 1) return parseInt(hourCount) + ' ' + GLOBAL_CONFIG.date_suffix.hour - if (minuteCount >= 1) return parseInt(minuteCount) + ' ' + GLOBAL_CONFIG.date_suffix.min - return GLOBAL_CONFIG.date_suffix.just + if (monthCount >= 1) return `${parseInt(monthCount)} ${dateSuffix.month}` + if (dayCount >= 1) return `${parseInt(dayCount)} ${dateSuffix.day}` + if (hourCount >= 1) return `${parseInt(hourCount)} ${dateSuffix.hour}` + if (minuteCount >= 1) return `${parseInt(minuteCount)} ${dateSuffix.min}` + return dateSuffix.just }, loadComment: (dom, callback) => {