diff --git a/scripts/events/lib/highlight.js b/scripts/events/lib/highlight.js index 128dc1f..86d61cb 100644 --- a/scripts/events/lib/highlight.js +++ b/scripts/events/lib/highlight.js @@ -1,8 +1,10 @@ +'use strict'; + const fs = require('fs'); const path = require('path'); -function resolve(package) { - return path.dirname(require.resolve(`${package}/package.json`)); +function resolve(name) { + return path.dirname(require.resolve(`${name}/package.json`)); } function highlightTheme(name) { diff --git a/scripts/helpers/font.js b/scripts/helpers/font.js index 41a9586..27527f7 100644 --- a/scripts/helpers/font.js +++ b/scripts/helpers/font.js @@ -2,6 +2,7 @@ 'use strict'; +// https://developers.google.com/fonts/docs/getting_started hexo.extend.helper.register('next_font', function() { const config = this.theme.font; @@ -18,7 +19,7 @@ hexo.extend.helper.register('next_font', function() { } }); - fontFamilies = fontFamilies.map(name => name.trim() + fontStyles); + fontFamilies = fontFamilies.map(name => name.trim().replace(/\s/g, '+') + fontStyles); fontFamilies = [...new Set(fontFamilies)].join('|'); // Merge extra parameters to the final processed font string diff --git a/scripts/tags/video.js b/scripts/tags/video.js index 57b7ea2..3452ebf 100644 --- a/scripts/tags/video.js +++ b/scripts/tags/video.js @@ -1,5 +1,5 @@ /** - * video.js | https://theme-next.js.org/docs/tag-plugins/video + * video.js | https://theme-next.js.org/docs/tag-plugins/ */ /* global hexo */ diff --git a/source/js/local-search.js b/source/js/local-search.js index da5d276..5e5ae15 100644 --- a/source/js/local-search.js +++ b/source/js/local-search.js @@ -219,7 +219,7 @@ document.addEventListener('DOMContentLoaded', () => { url : element.querySelector('url').textContent }; }) : JSON.parse(res); - // Only match articles with not empty titles + // Only match articles with non-empty titles datas = datas.filter(data => data.title).map(data => { data.title = data.title.trim(); data.content = data.content ? data.content.trim().replace(/<[^>]+>/g, '') : '';