mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-17 18:22:33 +00:00
25 lines
468 B
JavaScript
25 lines
468 B
JavaScript
/* global hexo */
|
|
|
|
'use strict';
|
|
|
|
const points = require('../events/lib/injects-point');
|
|
|
|
hexo.extend.filter.register('theme_inject', injects => {
|
|
const filePath = hexo.theme.config.custom_file_path;
|
|
|
|
if (!filePath) return;
|
|
|
|
points.views.forEach(key => {
|
|
if (filePath[key]) {
|
|
injects[key].file('custom', filePath[key]);
|
|
}
|
|
});
|
|
|
|
points.styles.forEach(key => {
|
|
if (filePath[key]) {
|
|
injects[key].push(filePath[key]);
|
|
}
|
|
});
|
|
|
|
}, 99);
|