Skip to content

Commit

Permalink
Release v8.0.0-rc.5
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenjoezhang committed Aug 1, 2020
1 parent 016487e commit 74ccc18
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
16 changes: 5 additions & 11 deletions scripts/filters/minify.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,21 @@ 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');
}

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);
});
}

Expand All @@ -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');
}
});
7 changes: 3 additions & 4 deletions scripts/helpers/next-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 74ccc18

Please sign in to comment.