mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-17 18:22:33 +00:00
Use strict mode & update comments
This commit is contained in:
parent
1f26b10d27
commit
d871eedbb6
@ -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) {
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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 */
|
||||
|
||||
@ -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, '') : '';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user