hexo-theme-shokax
Advanced tools
Comparing version 0.2.2 to 0.2.3
{ | ||
"name": "hexo-theme-shokax", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "a hexo theme based on shoka", | ||
@@ -36,2 +36,4 @@ "main": "index.js", | ||
"eslint-plugin-vue": "^9.10.0", | ||
"hexo-fs": "^4.1.1", | ||
"hexo-util": "^3.0.1", | ||
"instantsearch.js": "^4.53.0", | ||
@@ -38,0 +40,0 @@ "pjax": "^0.2.8", |
@@ -0,5 +1,7 @@ | ||
如果你访问的仓库地址是**zkz098/hexo-theme-shokaX**,请转为访问最新地址: [theme-shoka-x/hexo-theme-shokaX](https://github.com/theme-shoka-x/hexo-theme-shokaX) | ||
# hexo-theme-shokaX | ||
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fzkz098%2Fhexo-theme-shokaX.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fzkz098%2Fhexo-theme-shokaX?ref=badge_shield) | ||
![LICENSE]( https://img.shields.io/github/license/zkz098/hexo-theme-shokaX) | ||
![stars](https://img.shields.io/github/stars/zkz098/hexo-theme-shokaX) | ||
![LICENSE]( https://img.shields.io/github/license/theme-shoka-x/hexo-theme-shokaX) | ||
![stars](https://img.shields.io/github/stars/theme-shoka-x/hexo-theme-shokaX) | ||
![version](https://shields.io/npm/v/hexo-theme-shokax) | ||
@@ -76,2 +78,2 @@ | ||
## 特别鸣谢 | ||
[<img src="https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.png" width="25%">](https://jb.gg/OpenSourceSupport) | ||
[<img src="https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.png" width="25%">](https://jb.gg/OpenSourceSupport) |
@@ -8,9 +8,7 @@ const fmtNum = (num) => { | ||
const { i18n } = hexo.theme; | ||
const pangu = theme.pangu | ||
? require('pangu') | ||
: { | ||
spacing: (data) => { | ||
return data; | ||
} | ||
}; | ||
const pangu = { | ||
spacing: (data) => { | ||
return data; | ||
} | ||
}; | ||
locals.alternate = theme.alternate; | ||
@@ -17,0 +15,0 @@ locals.title = pangu.spacing(__('title') !== 'title' ? __('title') : config.title); |
'use strict'; | ||
const pagination = require('hexo-pagination'); | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const hexo_pagination_1 = __importDefault(require("hexo-pagination")); | ||
const fmtNum = num => { | ||
@@ -37,3 +41,3 @@ return num < 10 ? '0' + num : num; | ||
options.archive = true; | ||
result = result.concat(pagination(path, posts, { | ||
result = result.concat((0, hexo_pagination_1.default)(path, posts, { | ||
perPage: path === archiveDir ? 0 : perPage, | ||
@@ -40,0 +44,0 @@ layout: ['archive', 'index'], |
'use strict'; | ||
const merge = require('hexo-util').deepMerge || require('lodash/merge'); | ||
const fs = require('hexo-fs'); | ||
const path = require('path'); | ||
const yaml = require('js-yaml'); | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const hexo_util_1 = __importDefault(require("hexo-util")); | ||
const hexo_fs_1 = __importDefault(require("hexo-fs")); | ||
const path_1 = __importDefault(require("path")); | ||
const js_yaml_1 = __importDefault(require("js-yaml")); | ||
hexo.extend.filter.register('before_generate', () => { | ||
if (hexo.config.theme_config) { | ||
hexo.theme.config = merge(hexo.theme.config, hexo.config.theme_config); | ||
hexo.theme.config = hexo_util_1.default.deepMerge(hexo.theme.config, hexo.config.theme_config); | ||
} | ||
@@ -15,3 +19,3 @@ const data = hexo.locals.get('data'); | ||
if (data.languages[lang]) { | ||
i18n.set(lang, merge(i18n.get([lang]), data.languages[lang])); | ||
i18n.set(lang, hexo_util_1.default.deepMerge(i18n.get([lang]), data.languages[lang])); | ||
} | ||
@@ -26,4 +30,4 @@ }; | ||
const custom_file = 'source/_data/' + style + '.styl'; | ||
if (fs.existsSync(custom_file)) { | ||
hexo.theme.config.style[style] = path.resolve(hexo.base_dir, custom_file); | ||
if (hexo_fs_1.default.existsSync(custom_file)) { | ||
hexo.theme.config.style[style] = path_1.default.resolve(hexo.base_dir, custom_file); | ||
} | ||
@@ -35,4 +39,4 @@ } | ||
else { | ||
hexo.theme.config.image_list = yaml.load(fs.readFileSync(path.join(__dirname, '../../_images.yml'))); | ||
hexo.theme.config.image_list = js_yaml_1.default.load(hexo_fs_1.default.readFileSync(path_1.default.join(__dirname, '../../_images.yml'))); | ||
} | ||
}); |
'use strict'; | ||
const fs = require('hexo-fs'); | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const hexo_fs_1 = __importDefault(require("hexo-fs")); | ||
hexo.extend.generator.register('images', function (locals) { | ||
const theme = hexo.theme.config; | ||
const dir = 'source/_data/' + theme.assets + '/'; | ||
if (!fs.existsSync(dir)) { | ||
if (!hexo_fs_1.default.existsSync(dir)) { | ||
return; | ||
} | ||
const result = []; | ||
const files = fs.listDirSync(dir); | ||
const files = hexo_fs_1.default.listDirSync(dir); | ||
files.forEach((file) => { | ||
@@ -15,3 +19,3 @@ result.push({ | ||
data: function () { | ||
return fs.createReadStream(dir + file); | ||
return hexo_fs_1.default.createReadStream(dir + file); | ||
} | ||
@@ -18,0 +22,0 @@ }); |
'use strict'; | ||
const fs = require('hexo-fs'); | ||
const pagination = require('hexo-pagination'); | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const hexo_fs_1 = __importDefault(require("hexo-fs")); | ||
const hexo_pagination_1 = __importDefault(require("hexo-pagination")); | ||
hexo.config.index_generator = Object.assign({ | ||
@@ -30,23 +34,23 @@ per_page: typeof hexo.config.per_page === 'undefined' ? 10 : hexo.config.per_page, | ||
const cover = `source/_posts/${cat.slug}`; | ||
if (fs.existsSync(cover + '/cover.avif')) { | ||
if (hexo_fs_1.default.existsSync(cover + '/cover.avif')) { | ||
covers.push({ | ||
path: cat.slug + '/cover.avif', | ||
data: function () { | ||
return fs.createReadStream(cover + '/cover.avif'); | ||
return hexo_fs_1.default.createReadStream(cover + '/cover.avif'); | ||
} | ||
}); | ||
} | ||
else if (fs.existsSync(cover + '/cover.webp')) { | ||
else if (hexo_fs_1.default.existsSync(cover + '/cover.webp')) { | ||
covers.push({ | ||
path: cat.slug + '/cover.webp', | ||
data: function () { | ||
return fs.createReadStream(cover + '/cover.webp'); | ||
return hexo_fs_1.default.createReadStream(cover + '/cover.webp'); | ||
} | ||
}); | ||
} | ||
else if (fs.existsSync(cover + '/cover.jpg')) { | ||
else if (hexo_fs_1.default.existsSync(cover + '/cover.jpg')) { | ||
covers.push({ | ||
path: cat.slug + '/cover.jpg', | ||
data: function () { | ||
return fs.createReadStream(cover + '/cover.jpg'); | ||
return hexo_fs_1.default.createReadStream(cover + '/cover.jpg'); | ||
} | ||
@@ -78,3 +82,3 @@ }); | ||
if (posts.length > 0) { | ||
pages = pagination(path, posts, { | ||
pages = (0, hexo_pagination_1.default)(path, posts, { | ||
perPage: config.index_generator.per_page, | ||
@@ -81,0 +85,0 @@ layout: ['index', 'archive'], |
@@ -1,2 +0,8 @@ | ||
const fs = require('hexo-fs'); | ||
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const package_json_1 = __importDefault(require("../../package.json")); | ||
const hexo_fs_1 = __importDefault(require("hexo-fs")); | ||
hexo.extend.generator.register('script', function (locals) { | ||
@@ -6,5 +12,4 @@ const log = hexo.log || console.log; | ||
const theme = hexo.theme.config; | ||
const env = require('../../package.json'); | ||
const siteConfig = { | ||
version: env.version, | ||
version: package_json_1.default.version, | ||
hostname: config.url, | ||
@@ -60,23 +65,23 @@ root: config.root, | ||
['library', 'global', 'page', 'vue', 'components'].forEach(function (item) { | ||
if (fs.existsSync(`themes/shokaX/source/js/_app/${item}.js`)) { | ||
text += fs.readFileSync(`themes/shokaX/source/js/_app/${item}.js`).toString(); | ||
if (hexo_fs_1.default.existsSync(`themes/shokaX/source/js/_app/${item}.js`)) { | ||
text += hexo_fs_1.default.readFileSync(`themes/shokaX/source/js/_app/${item}.js`).toString(); | ||
} | ||
else { | ||
text += fs.readFileSync(`node_modules/hexo-theme-shokax/source/js/_app/${item}.js`).toString(); | ||
text += hexo_fs_1.default.readFileSync(`node_modules/hexo-theme-shokax/source/js/_app/${item}.js`).toString(); | ||
} | ||
}); | ||
if (!theme.experiments?.noPlayer) { | ||
if (fs.existsSync('themes/shokaX/source/js/_app/player.js')) { | ||
text += fs.readFileSync('themes/shokaX/source/js/_app/player.js').toString(); | ||
if (hexo_fs_1.default.existsSync('themes/shokaX/source/js/_app/player.js')) { | ||
text += hexo_fs_1.default.readFileSync('themes/shokaX/source/js/_app/player.js').toString(); | ||
} | ||
else { | ||
text += fs.readFileSync('node_modules/hexo-theme-shokax/source/js/_app/player.js').toString(); | ||
text += hexo_fs_1.default.readFileSync('node_modules/hexo-theme-shokax/source/js/_app/player.js').toString(); | ||
} | ||
} | ||
if (theme.fireworks && theme.fireworks.enable) { | ||
if (fs.existsSync('themes/shokaX/source/js/_app/fireworks.js')) { | ||
text += fs.readFileSync('themes/shokaX/source/js/_app/fireworks.js').toString(); | ||
if (hexo_fs_1.default.existsSync('themes/shokaX/source/js/_app/fireworks.js')) { | ||
text += hexo_fs_1.default.readFileSync('themes/shokaX/source/js/_app/fireworks.js').toString(); | ||
} | ||
else { | ||
text += fs.readFileSync('node_modules/hexo-theme-shokax/source/js/_app/fireworks.js').toString(); | ||
text += hexo_fs_1.default.readFileSync('node_modules/hexo-theme-shokax/source/js/_app/fireworks.js').toString(); | ||
} | ||
@@ -83,0 +88,0 @@ siteConfig.fireworks = theme.fireworks.color || ['rgba(255,182,185,.9)', 'rgba(250,227,217,.9)', 'rgba(187,222,214,.9)', 'rgba(138,198,209,.9)']; |
@@ -1,3 +0,8 @@ | ||
import theme_env from '../../package.json'; | ||
import { htmlTag, url_for, stripHTML } from 'hexo-util'; | ||
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const package_json_1 = __importDefault(require("../../package.json")); | ||
const hexo_util_1 = require("hexo-util"); | ||
hexo.extend.helper.register('_new_comments', function (mode) { | ||
@@ -59,3 +64,3 @@ if (mode === 'twikoo') { | ||
hexo.extend.helper.register('theme_env', function (type) { | ||
return theme_env[type]; | ||
return package_json_1.default[type]; | ||
}); | ||
@@ -80,3 +85,3 @@ hexo.extend.helper.register('_vendor_font', () => { | ||
return fontFamilies | ||
? htmlTag('link', { | ||
? (0, hexo_util_1.htmlTag)('link', { | ||
rel: 'stylesheet', | ||
@@ -100,9 +105,9 @@ href: `${fontHost}/css?family=${fontFamilies.concat(fontDisplay, fontSubset)}` | ||
vendorJs = vendorJs.join(','); | ||
return vendorJs ? htmlTag('script', { src: `https://cdn.jsdelivr.net/combine/${vendorJs}` }, '') : ''; | ||
return vendorJs ? (0, hexo_util_1.htmlTag)('script', { src: `https://cdn.jsdelivr.net/combine/${vendorJs}` }, '') : ''; | ||
}); | ||
hexo.extend.helper.register('_css', function (...urls) { | ||
const { statics, css } = hexo.theme.config; | ||
return urls.map(url => htmlTag('link', { | ||
return urls.map(url => (0, hexo_util_1.htmlTag)('link', { | ||
rel: 'stylesheet', | ||
href: url_for.call(this, `${statics}${css}/${url}?v=${theme_env.version}`) | ||
href: hexo_util_1.url_for.call(this, `${statics}${css}/${url}?v=${package_json_1.default.version}`) | ||
})).join(''); | ||
@@ -112,3 +117,3 @@ }); | ||
const { statics, js } = hexo.theme.config; | ||
return urls.map(url => htmlTag('script', { src: url_for.call(this, `${statics}${js}/${url}?v=${theme_env.version}`) }, '')).join(''); | ||
return urls.map(url => (0, hexo_util_1.htmlTag)('script', { src: hexo_util_1.url_for.call(this, `${statics}${js}/${url}?v=${package_json_1.default.version}`) }, '')).join(''); | ||
}); | ||
@@ -165,10 +170,10 @@ hexo.extend.helper.register('_list_vendor_js', () => { | ||
if (config.deferLoad) { | ||
return htmlTag('script', { 'data-pjax': true }, ` | ||
return (0, hexo_util_1.htmlTag)('script', { 'data-pjax': true }, ` | ||
const script=document.createElement("script");script.src="${result}",script.async=true,document.body.appendChild(script) | ||
`); | ||
} | ||
return htmlTag('script', attr, ''); | ||
return (0, hexo_util_1.htmlTag)('script', attr, ''); | ||
}); | ||
hexo.extend.helper.register('_striptags', function (data) { | ||
return stripHTML(data); | ||
return (0, hexo_util_1.stripHTML)(data); | ||
}); | ||
@@ -175,0 +180,0 @@ hexo.extend.helper.register('_truncate', function (data, end) { |
'use strict'; | ||
import { htmlTag, url_for } from 'hexo-util'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const hexo_util_1 = require("hexo-util"); | ||
const randomServer = parseInt(String(Math.random() * 4), 10) + 1; | ||
@@ -56,3 +57,3 @@ const randomBG = function (count = 1, image_server = null, image_list = []) { | ||
let tag = 'a'; | ||
let attrs = { href: url_for.call(this, path), class: undefined, external: undefined, rel: undefined, 'data-url': undefined }; | ||
let attrs = { href: hexo_util_1.url_for.call(this, path), class: undefined, external: undefined, rel: undefined, 'data-url': undefined }; | ||
if (theme.exturl && data.protocol && data.hostname !== siteHost) { | ||
@@ -88,3 +89,3 @@ tag = 'span'; | ||
} | ||
return htmlTag(tag, attrs, decodeURI(text), false); | ||
return (0, hexo_util_1.htmlTag)(tag, attrs, decodeURI(text), false); | ||
}); | ||
@@ -98,3 +99,3 @@ hexo.extend.helper.register('_image_url', function (img, path = '') { | ||
else { | ||
return url_for.call(this, statics + (post_asset_folder ? path : '') + img); | ||
return hexo_util_1.url_for.call(this, statics + (post_asset_folder ? path : '') + img); | ||
} | ||
@@ -128,3 +129,3 @@ }); | ||
const base = path.startsWith(lang) ? path.slice(lang.length + 1) : path; | ||
return url_for.call(this, `${this.languages.indexOf(language) === 0 ? '' : '/' + language}/${base}`); | ||
return hexo_util_1.url_for.call(this, `${this.languages.indexOf(language) === 0 ? '' : '/' + language}/${base}`); | ||
}); | ||
@@ -131,0 +132,0 @@ hexo.extend.helper.register('language_name', function (language) { |
'use strict'; | ||
import fs from 'hexo-fs'; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const hexo_fs_1 = __importDefault(require("hexo-fs")); | ||
const prepareQuery = (categories, parent) => { | ||
@@ -53,9 +57,7 @@ const query = { | ||
return ''; | ||
const pangu = this.theme.pangu | ||
? require('pangu') | ||
: { | ||
spacing: data => { | ||
return data; | ||
} | ||
}; | ||
const pangu = { | ||
spacing: data => { | ||
return data; | ||
} | ||
}; | ||
const result = {}; | ||
@@ -65,3 +67,3 @@ categories.forEach((cat, i) => { | ||
const cover = 'source/_posts' + cat.path.replace(this.config.category_dir, '') + 'cover.jpg'; | ||
if (fs.existsSync(cover)) { | ||
if (hexo_fs_1.default.existsSync(cover)) { | ||
const className = cat.slug.split('/'); | ||
@@ -68,0 +70,0 @@ className.pop(); |
'use strict'; | ||
import { stripHTML } from 'hexo-util'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const hexo_util_1 = require("hexo-util"); | ||
const config = hexo.config.symbols_count_time = Object.assign({ | ||
@@ -61,3 +62,3 @@ symbols: true, | ||
content = content.replace(/<pre>.*?<\/pre>/g, ''); | ||
data.length = stripHTML(content).replace(/\r?\n|\r/g, '').replace(/\s+/g, '').length; | ||
data.length = (0, hexo_util_1.stripHTML)(content).replace(/\r?\n|\r/g, '').replace(/\s+/g, '').length; | ||
}, 0); |
@@ -0,9 +1,14 @@ | ||
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const injects_1 = __importDefault(require("./lib/injects")); | ||
const node_https_1 = __importDefault(require("node:https")); | ||
const package_json_1 = require("../../package.json"); | ||
hexo.on('generateBefore', () => { | ||
require('./lib/injects')(hexo); | ||
(0, injects_1.default)(hexo); | ||
}); | ||
hexo.on('generateAfter', () => { | ||
const https = require('https'); | ||
const path = require('path'); | ||
const { version } = require(path.normalize('../../package.json')); | ||
https.get('https://api.github.com/repos/theme-shoka-x/hexo-theme-shokaX/releases/latest', { | ||
node_https_1.default.get('https://api.github.com/repos/theme-shoka-x/hexo-theme-shokaX/releases/latest', { | ||
headers: { | ||
@@ -20,3 +25,3 @@ 'User-Agent': 'Theme ShokaX Client' | ||
const latest = JSON.parse(result).tag_name.replace('v', '').split('.'); | ||
const current = version.split('.'); | ||
const current = package_json_1.version.split('.'); | ||
let isOutdated = false; | ||
@@ -23,0 +28,0 @@ for (let i = 0; i < Math.max(latest.length, current.length); i++) { |
'use strict'; | ||
export default { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = { | ||
views: [ | ||
@@ -4,0 +5,0 @@ 'head', |
'use strict'; | ||
import fs from 'node:fs'; | ||
import path from 'node:path'; | ||
import points from './injects-point'; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const node_fs_1 = __importDefault(require("node:fs")); | ||
const node_path_1 = __importDefault(require("node:path")); | ||
const injects_point_1 = __importDefault(require("./injects-point")); | ||
const defaultExtname = '.pug'; | ||
@@ -12,3 +16,3 @@ class StylusInject { | ||
push(file) { | ||
this.files.push(path.resolve(this.base_dir, file)); | ||
this.files.push(node_path_1.default.resolve(this.base_dir, file)); | ||
} | ||
@@ -22,3 +26,3 @@ } | ||
raw(name, raw, ...args) { | ||
if (path.extname(name) === '') { | ||
if (node_path_1.default.extname(name) === '') { | ||
name += defaultExtname; | ||
@@ -29,6 +33,6 @@ } | ||
file(name, file, ...args) { | ||
if (path.extname(name) === '') { | ||
name += path.extname(file); | ||
if (node_path_1.default.extname(name) === '') { | ||
name += node_path_1.default.extname(file); | ||
} | ||
this.raw(name, fs.readFileSync(path.resolve(this.base_dir, file), 'utf8'), ...args); | ||
this.raw(name, node_fs_1.default.readFileSync(node_path_1.default.resolve(this.base_dir, file), 'utf8'), ...args); | ||
} | ||
@@ -38,6 +42,6 @@ } | ||
const injects = {}; | ||
points.styles.forEach(item => { | ||
injects_point_1.default.styles.forEach(item => { | ||
injects[item] = new StylusInject(base_dir); | ||
}); | ||
points.views.forEach(item => { | ||
injects_point_1.default.views.forEach(item => { | ||
injects[item] = new ViewInject(base_dir); | ||
@@ -47,10 +51,10 @@ }); | ||
} | ||
module.exports = (hexo) => { | ||
exports.default = (hexo) => { | ||
const injects = initInject(hexo.base_dir); | ||
hexo.execFilterSync('theme_inject', injects); | ||
hexo.theme.config.injects = {}; | ||
points.styles.forEach(type => { | ||
injects_point_1.default.styles.forEach(type => { | ||
hexo.theme.config.injects[type] = injects[type].files; | ||
}); | ||
points.views.forEach(type => { | ||
injects_point_1.default.views.forEach(type => { | ||
const configs = Object.create(null); | ||
@@ -57,0 +61,0 @@ hexo.theme.config.injects[type] = []; |
'use strict'; | ||
import fs from 'node:fs'; | ||
import path from 'node:path'; | ||
import yaml from 'js-yaml'; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const node_fs_1 = __importDefault(require("node:fs")); | ||
const node_path_1 = __importDefault(require("node:path")); | ||
const js_yaml_1 = __importDefault(require("js-yaml")); | ||
function linkGrid(args, content) { | ||
@@ -11,5 +15,5 @@ const theme = hexo.theme.config; | ||
if (args[0]) { | ||
const filepath = path.join(hexo.source_dir, args[0]); | ||
if (fs.existsSync(filepath)) { | ||
content = fs.readFileSync(filepath); | ||
const filepath = node_path_1.default.join(hexo.source_dir, args[0]); | ||
if (node_fs_1.default.existsSync(filepath)) { | ||
content = node_fs_1.default.readFileSync(filepath); | ||
} | ||
@@ -21,3 +25,3 @@ } | ||
const siteHost = new URL(hexo.config.url).hostname || hexo.config.url; | ||
const list = yaml.load(content); | ||
const list = js_yaml_1.default.load(content); | ||
let result = ''; | ||
@@ -24,0 +28,0 @@ list.forEach((item) => { |
'use strict'; | ||
import yaml from 'js-yaml'; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const js_yaml_1 = __importDefault(require("js-yaml")); | ||
function postMedia(args, content) { | ||
@@ -7,3 +11,3 @@ if (!args[0] || !content) { | ||
} | ||
const list = yaml.load(content); | ||
const list = js_yaml_1.default.load(content); | ||
switch (args[0]) { | ||
@@ -10,0 +14,0 @@ case 'video': |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
556119
168
5307
79
1
5
28