mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-19 18:42:34 +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 fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
function resolve(package) {
|
function resolve(name) {
|
||||||
return path.dirname(require.resolve(`${package}/package.json`));
|
return path.dirname(require.resolve(`${name}/package.json`));
|
||||||
}
|
}
|
||||||
|
|
||||||
function highlightTheme(name) {
|
function highlightTheme(name) {
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
// https://developers.google.com/fonts/docs/getting_started
|
||||||
hexo.extend.helper.register('next_font', function() {
|
hexo.extend.helper.register('next_font', function() {
|
||||||
const config = this.theme.font;
|
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('|');
|
fontFamilies = [...new Set(fontFamilies)].join('|');
|
||||||
|
|
||||||
// Merge extra parameters to the final processed font string
|
// 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 */
|
/* global hexo */
|
||||||
|
|||||||
@ -219,7 +219,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
url : element.querySelector('url').textContent
|
url : element.querySelector('url').textContent
|
||||||
};
|
};
|
||||||
}) : JSON.parse(res);
|
}) : 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 => {
|
datas = datas.filter(data => data.title).map(data => {
|
||||||
data.title = data.title.trim();
|
data.title = data.title.trim();
|
||||||
data.content = data.content ? data.content.trim().replace(/<[^>]+>/g, '') : '';
|
data.content = data.content ? data.content.trim().replace(/<[^>]+>/g, '') : '';
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user