Release v8.0.0-rc.5

This commit is contained in:
Mimi 2020-08-01 08:56:17 +08:00
parent 016487efa3
commit 74ccc182f3
3 changed files with 9 additions and 16 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "hexo-theme-next", "name": "hexo-theme-next",
"version": "8.0.0-rc.4", "version": "8.0.0-rc.5",
"description": "Elegant and powerful theme for Hexo.", "description": "Elegant and powerful theme for Hexo.",
"main": "package.json", "main": "package.json",
"scripts": { "scripts": {

View File

@ -6,9 +6,6 @@ hexo.extend.filter.register('after_generate', () => {
const theme = hexo.theme.config; const theme = hexo.theme.config;
if (!theme.minify) return; if (!theme.minify) return;
const lists = hexo.route.list();
const fontawesome = lists.filter(list => list.includes('lib/font-awesome'));
if (!theme.bookmark.enable) { if (!theme.bookmark.enable) {
hexo.route.remove('js/bookmark.js'); hexo.route.remove('js/bookmark.js');
} }
@ -16,15 +13,14 @@ hexo.extend.filter.register('after_generate', () => {
if (!theme.motion.enable) { if (!theme.motion.enable) {
hexo.route.remove('js/motion.js'); hexo.route.remove('js/motion.js');
hexo.route.remove('lib/animate-css/animate.min.css'); hexo.route.remove('lib/animate-css/animate.min.css');
} } else if (theme.vendors.animate_css) {
if (theme.motion.enable && theme.vendors.animate_css) {
hexo.route.remove('lib/animate-css/animate.min.css'); hexo.route.remove('lib/animate-css/animate.min.css');
} }
if (theme.vendors.fontawesome) { if (theme.vendors.fontawesome) {
fontawesome.forEach(path => { const lists = hexo.route.list();
hexo.route.remove(path); 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'); hexo.route.remove('js/local-search.js');
} }
if (theme.scheme === 'Muse' || theme.scheme === 'Mist') { if (theme.scheme === 'Pisces' || theme.scheme === 'Gemini') {
hexo.route.remove('js/schemes/pisces.js');
} else if (theme.scheme === 'Pisces' || theme.scheme === 'Gemini') {
hexo.route.remove('js/schemes/muse.js'); hexo.route.remove('js/schemes/muse.js');
} }
}); });

View File

@ -26,17 +26,16 @@ hexo.extend.helper.register('next_config', function() {
motion : theme.motion, motion : theme.motion,
prism : config.prismjs.enable && !config.prismjs.preprocess prism : config.prismjs.enable && !config.prismjs.preprocess
}; };
if (theme.algolia_search && theme.algolia_search.enable) { if (config.algolia && theme.algolia_search && theme.algolia_search.enable) {
config.algolia = config.algolia || {};
exportConfig.algolia = { exportConfig.algolia = {
appID : config.algolia.applicationID, appID : config.algolia.applicationID || config.algolia.appId,
apiKey : config.algolia.apiKey, apiKey : config.algolia.apiKey,
indexName: config.algolia.indexName, indexName: config.algolia.indexName,
hits : theme.algolia_search.hits, hits : theme.algolia_search.hits,
labels : theme.algolia_search.labels labels : theme.algolia_search.labels
}; };
} }
if (config.search) { if (config.search && theme.local_search && theme.local_search.enable) {
exportConfig.path = config.search.path; exportConfig.path = config.search.path;
exportConfig.localsearch = theme.local_search; exportConfig.localsearch = theme.local_search;
} }