From 74ccc182f3a9d661b30b4084b3ccf1d063a282d4 Mon Sep 17 00:00:00 2001 From: Mimi <1119186082@qq.com> Date: Sat, 1 Aug 2020 08:56:17 +0800 Subject: [PATCH] Release v8.0.0-rc.5 --- package.json | 2 +- scripts/filters/minify.js | 16 +++++----------- scripts/helpers/next-config.js | 7 +++---- 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index e87f3a2..338c62b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hexo-theme-next", - "version": "8.0.0-rc.4", + "version": "8.0.0-rc.5", "description": "Elegant and powerful theme for Hexo.", "main": "package.json", "scripts": { diff --git a/scripts/filters/minify.js b/scripts/filters/minify.js index e3ebbb7..7eef088 100644 --- a/scripts/filters/minify.js +++ b/scripts/filters/minify.js @@ -6,9 +6,6 @@ hexo.extend.filter.register('after_generate', () => { const theme = hexo.theme.config; if (!theme.minify) return; - const lists = hexo.route.list(); - const fontawesome = lists.filter(list => list.includes('lib/font-awesome')); - if (!theme.bookmark.enable) { hexo.route.remove('js/bookmark.js'); } @@ -16,15 +13,14 @@ hexo.extend.filter.register('after_generate', () => { if (!theme.motion.enable) { hexo.route.remove('js/motion.js'); hexo.route.remove('lib/animate-css/animate.min.css'); - } - - if (theme.motion.enable && theme.vendors.animate_css) { + } else if (theme.vendors.animate_css) { hexo.route.remove('lib/animate-css/animate.min.css'); } if (theme.vendors.fontawesome) { - fontawesome.forEach(path => { - hexo.route.remove(path); + const lists = hexo.route.list(); + lists.forEach(path => { + if (path.startsWith('lib/font-awesome')) hexo.route.remove(path); }); } @@ -40,9 +36,7 @@ hexo.extend.filter.register('after_generate', () => { hexo.route.remove('js/local-search.js'); } - if (theme.scheme === 'Muse' || theme.scheme === 'Mist') { - hexo.route.remove('js/schemes/pisces.js'); - } else if (theme.scheme === 'Pisces' || theme.scheme === 'Gemini') { + if (theme.scheme === 'Pisces' || theme.scheme === 'Gemini') { hexo.route.remove('js/schemes/muse.js'); } }); diff --git a/scripts/helpers/next-config.js b/scripts/helpers/next-config.js index 89d5b9a..6333f19 100644 --- a/scripts/helpers/next-config.js +++ b/scripts/helpers/next-config.js @@ -26,17 +26,16 @@ hexo.extend.helper.register('next_config', function() { motion : theme.motion, prism : config.prismjs.enable && !config.prismjs.preprocess }; - if (theme.algolia_search && theme.algolia_search.enable) { - config.algolia = config.algolia || {}; + if (config.algolia && theme.algolia_search && theme.algolia_search.enable) { exportConfig.algolia = { - appID : config.algolia.applicationID, + appID : config.algolia.applicationID || config.algolia.appId, apiKey : config.algolia.apiKey, indexName: config.algolia.indexName, hits : theme.algolia_search.hits, labels : theme.algolia_search.labels }; } - if (config.search) { + if (config.search && theme.local_search && theme.local_search.enable) { exportConfig.path = config.search.path; exportConfig.localsearch = theme.local_search; }