hexo-theme-shokax 0.2.1 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,12 +1,13 @@
1
- /* global hexo */
2
-
3
- 'use strict'
4
- const { htmlTag, url_for, stripHTML } = require('hexo-util')
5
- const theme_env = require('../../package.json')
6
-
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const package_json_1 = __importDefault(require("../../package.json"));
7
+ const hexo_util_1 = require("hexo-util");
7
8
  hexo.extend.helper.register('_new_comments', function (mode) {
8
- if (mode === 'twikoo') {
9
- return `<script data-pjax type="module">
9
+ if (mode === 'twikoo') {
10
+ return `<script data-pjax type="module">
10
11
  let comments = []
11
12
  twikoo.getRecentComments({
12
13
  envId: "${hexo.theme.config?.twikoo?.envId}",
@@ -35,9 +36,10 @@ hexo.extend.helper.register('_new_comments', function (mode) {
35
36
  }).catch(function (err) {
36
37
  console.error(err)
37
38
  })
38
- </script>`
39
- } else if (mode === 'waline') {
40
- return `
39
+ </script>`;
40
+ }
41
+ else if (mode === 'waline') {
42
+ return `
41
43
  <script type="module" data-pjax>
42
44
  import { RecentComments } from 'https://unpkg.com/@waline/client@v2/dist/waline.mjs'
43
45
  RecentComments({
@@ -46,138 +48,130 @@ hexo.extend.helper.register('_new_comments', function (mode) {
46
48
  count: 10,
47
49
  });
48
50
  </script>
49
- `
50
- } else {
51
- console.log(`${mode} is not supported recent comment`)
52
- }
53
- })
54
-
51
+ `;
52
+ }
53
+ else {
54
+ console.log(`${mode} is not supported recent comment`);
55
+ }
56
+ });
55
57
  hexo.extend.helper.register('_safedump', (source) => {
56
- return JSON.stringify(source)
57
- })
58
-
58
+ return JSON.stringify(source);
59
+ });
59
60
  hexo.extend.helper.register('hexo_env', function (type) {
60
- return this.env[type]
61
- })
62
-
61
+ return this.env[type];
62
+ });
63
63
  hexo.extend.helper.register('theme_env', function (type) {
64
- return theme_env[type]
65
- })
66
-
64
+ return package_json_1.default[type];
65
+ });
67
66
  hexo.extend.helper.register('_vendor_font', () => {
68
- const config = hexo.theme.config.font
69
-
70
- if (!config || !config.enable) return ''
71
-
72
- const fontDisplay = '&display=swap'
73
- const fontSubset = '&subset=latin,latin-ext'
74
- const fontStyles = ':300,300italic,400,400italic,700,700italic'
75
- const fontHost = '//fonts.geekzu.org'
76
-
77
- // Get a font list from config
78
- let fontFamilies = ['global', 'logo', 'title', 'headings', 'posts', 'codes'].map(item => {
79
- if (config[item] && config[item].family && config[item].external) {
80
- return config[item].family + fontStyles
81
- }
82
- return ''
83
- })
84
-
85
- fontFamilies = fontFamilies.filter(item => item !== '')
86
- fontFamilies = [...new Set(fontFamilies)]
87
- fontFamilies = fontFamilies.join('|')
88
-
89
- // Merge extra parameters to the final processed font string
90
- return fontFamilies
91
- ? htmlTag('link', {
92
- rel: 'stylesheet',
93
- href: `${fontHost}/css?family=${fontFamilies.concat(fontDisplay, fontSubset)}`
94
- })
95
- : ''
96
- })
97
-
98
- // TODO 废弃方法
67
+ const config = hexo.theme.config.font;
68
+ if (!config || !config.enable)
69
+ return '';
70
+ const fontDisplay = '&display=swap';
71
+ const fontSubset = '&subset=latin,latin-ext';
72
+ const fontStyles = ':300,300italic,400,400italic,700,700italic';
73
+ const fontHost = '//fonts.geekzu.org';
74
+ let fontFamilies = ['global', 'logo', 'title', 'headings', 'posts', 'codes'].map(item => {
75
+ if (config[item] && config[item].family && config[item].external) {
76
+ return config[item].family + fontStyles;
77
+ }
78
+ return '';
79
+ });
80
+ fontFamilies = fontFamilies.filter(item => item !== '');
81
+ fontFamilies = [...new Set(fontFamilies)];
82
+ fontFamilies = fontFamilies.join('|');
83
+ return fontFamilies
84
+ ? (0, hexo_util_1.htmlTag)('link', {
85
+ rel: 'stylesheet',
86
+ href: `${fontHost}/css?family=${fontFamilies.concat(fontDisplay, fontSubset)}`
87
+ })
88
+ : '';
89
+ });
99
90
  hexo.extend.helper.register('_vendor_js', () => {
100
- const config = hexo.theme.config.vendors.js
101
-
102
- if (!config) return ''
103
-
104
- // Get a font list from config
105
- let vendorJs = ['pace', 'pjax', 'fetch', 'anime', 'algolia', 'instantsearch', 'lazyload', 'quicklink'].map(item => {
106
- if (config[item]) {
107
- return config[item]
108
- }
109
- return ''
110
- })
111
-
112
- vendorJs = vendorJs.filter(item => item !== '')
113
- vendorJs = [...new Set(vendorJs)]
114
- vendorJs = vendorJs.join(',')
115
- return vendorJs ? htmlTag('script', { src: `https://cdn.jsdelivr.net/combine/${vendorJs}` }, '') : ''
116
- })
117
-
91
+ const config = hexo.theme.config.vendors.js;
92
+ if (!config)
93
+ return '';
94
+ let vendorJs = ['pace', 'pjax', 'fetch', 'anime', 'algolia', 'instantsearch', 'lazyload', 'quicklink'].map(item => {
95
+ if (config[item]) {
96
+ return config[item];
97
+ }
98
+ return '';
99
+ });
100
+ vendorJs = vendorJs.filter(item => item !== '');
101
+ vendorJs = [...new Set(vendorJs)];
102
+ vendorJs = vendorJs.join(',');
103
+ return vendorJs ? (0, hexo_util_1.htmlTag)('script', { src: `https://cdn.jsdelivr.net/combine/${vendorJs}` }, '') : '';
104
+ });
118
105
  hexo.extend.helper.register('_css', function (...urls) {
119
- const { statics, css } = hexo.theme.config
120
-
121
- return urls.map(url => htmlTag('link', {
122
- rel: 'stylesheet',
123
- href: url_for.call(this, `${statics}${css}/${url}?v=${theme_env.version}`)
124
- })).join('')
125
- })
126
-
106
+ const { statics, css } = hexo.theme.config;
107
+ return urls.map(url => (0, hexo_util_1.htmlTag)('link', {
108
+ rel: 'stylesheet',
109
+ href: hexo_util_1.url_for.call(this, `${statics}${css}/${url}?v=${package_json_1.default.version}`)
110
+ })).join('');
111
+ });
127
112
  hexo.extend.helper.register('_js', function (...urls) {
128
- const { statics, js } = hexo.theme.config
129
-
130
- return urls.map(url => htmlTag('script', { src: url_for.call(this, `${statics}${js}/${url}?v=${theme_env.version}`) }, '')).join('')
131
- })
113
+ const { statics, js } = hexo.theme.config;
114
+ 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('');
115
+ });
132
116
  hexo.extend.helper.register('_list_vendor_js', () => {
133
- return hexo.theme.config.vendorsList.js
134
- })
135
-
117
+ return hexo.theme.config.vendorsList.js;
118
+ });
136
119
  hexo.extend.helper.register('_adv_vendor_js', function (js_name) {
137
- const srcHelpers = (src) => { return src.endsWith('/') ? src : src + '/' }
138
- const config = hexo.theme.config.advVendors.js[js_name]
139
- const themeConfig = hexo.theme.config
140
- const src = config.src
141
- const publicCdns = {
142
- npm: srcHelpers(themeConfig.advVendors.npm),
143
- gh: srcHelpers(themeConfig.advVendors.github),
144
- combine: srcHelpers(themeConfig.advVendors.combine),
145
- bytedance: 'https://lf9-cdn-tos.bytecdntp.com/cdn/expire-6-M/',
146
- baomitu: 'https://lib.baomitu.com/'
147
- }
148
- let result
149
- if (src.startsWith('http')) {
150
- result = src
151
- } else if (src.startsWith('combine:')) {
152
- hexo.log.info('The combine feature is not recommended!')
153
- result = publicCdns.combine + src
154
- } else if (src.startsWith('npm:')) {
155
- result = publicCdns.npm + src.substring(4)
156
- } else if (src.startsWith('gh:')) {
157
- result = publicCdns.gh + src.substring(3)
158
- } else if (src.startsWith('bytedance:')) {
159
- result = publicCdns.bytedance + src.substring(10)
160
- } else if (src.startsWith('baomitu:')) {
161
- result = publicCdns.baomitu + src.substring(8)
162
- } else {
163
- result = '/' + src
164
- }
165
- const attr = { src: result }
166
- if (config.async) attr.async = 'async'
167
- if (config['data-pjax']) attr['data-pjax'] = 'data-pjax'
168
- if (config['hash-value']) attr.integrity = config['hash-value']
169
- if (config.deferLoad) {
170
- return htmlTag('script', { 'data-pjax': true }, `
120
+ const srcHelpers = (src) => { return src.endsWith('/') ? src : src + '/'; };
121
+ const config = hexo.theme.config.advVendors.js[js_name];
122
+ const themeConfig = hexo.theme.config;
123
+ const src = config.src;
124
+ const publicCdns = {
125
+ npm: srcHelpers(themeConfig.advVendors.npm),
126
+ gh: srcHelpers(themeConfig.advVendors.github),
127
+ combine: srcHelpers(themeConfig.advVendors.combine),
128
+ bytedance: 'https://lf9-cdn-tos.bytecdntp.com/cdn/expire-6-M/',
129
+ baomitu: 'https://lib.baomitu.com/'
130
+ };
131
+ let result;
132
+ if (src.startsWith('http')) {
133
+ result = src;
134
+ }
135
+ else if (src.startsWith('combine:')) {
136
+ hexo.log.info('The combine feature is not recommended!');
137
+ result = publicCdns.combine + src;
138
+ }
139
+ else if (src.startsWith('npm:')) {
140
+ result = publicCdns.npm + src.substring(4);
141
+ }
142
+ else if (src.startsWith('gh:')) {
143
+ result = publicCdns.gh + src.substring(3);
144
+ }
145
+ else if (src.startsWith('bytedance:')) {
146
+ result = publicCdns.bytedance + src.substring(10);
147
+ }
148
+ else if (src.startsWith('baomitu:')) {
149
+ result = publicCdns.baomitu + src.substring(8);
150
+ }
151
+ else {
152
+ result = '/' + src;
153
+ }
154
+ const attr = {
155
+ src: result,
156
+ integrity: undefined,
157
+ async: undefined
158
+ };
159
+ if (config.async)
160
+ attr.async = 'async';
161
+ if (config['data-pjax'])
162
+ attr['data-pjax'] = 'data-pjax';
163
+ if (config['hash-value'])
164
+ attr.integrity = config['hash-value'];
165
+ if (config.deferLoad) {
166
+ return (0, hexo_util_1.htmlTag)('script', { 'data-pjax': true }, `
171
167
  const script=document.createElement("script");script.src="${result}",script.async=true,document.body.appendChild(script)
172
- `)
173
- }
174
- return htmlTag('script', attr, '')
175
- })
176
-
168
+ `);
169
+ }
170
+ return (0, hexo_util_1.htmlTag)('script', attr, '');
171
+ });
177
172
  hexo.extend.helper.register('_striptags', function (data) {
178
- return stripHTML(data)
179
- })
180
-
173
+ return (0, hexo_util_1.stripHTML)(data);
174
+ });
181
175
  hexo.extend.helper.register('_truncate', function (data, end) {
182
- return data.substring(0, end)
183
- })
176
+ return data.substring(0, end);
177
+ });
@@ -1,201 +1,144 @@
1
- /* global hexo */
2
-
3
- 'use strict'
4
-
5
- const { htmlTag, url_for } = require('hexo-util')
6
-
7
- const randomServer = parseInt(String(Math.random() * 4), 10) + 1
8
-
1
+ 'use strict';
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const hexo_util_1 = require("hexo-util");
4
+ const randomServer = parseInt(String(Math.random() * 4), 10) + 1;
9
5
  const randomBG = function (count = 1, image_server = null, image_list = []) {
10
- let i
11
- if (image_server) {
6
+ let i;
7
+ if (image_server) {
8
+ if (count && count > 1) {
9
+ const arr = new Array(count);
10
+ for (i = 0; i < arr.length; i++) {
11
+ arr[i] = image_server + '?' + Math.floor(Math.random() * 999999);
12
+ }
13
+ return arr;
14
+ }
15
+ return image_server + '?' + Math.floor(Math.random() * 999999);
16
+ }
17
+ const parseImage = function (img, size) {
18
+ if (img.startsWith('//') || img.startsWith('http')) {
19
+ return img;
20
+ }
21
+ else if (hexo.theme.config.experiments?.usingRelative) {
22
+ return img;
23
+ }
24
+ else {
25
+ console.warn("sinaimg blocked all request from outside website,so don't use this format");
26
+ return `https://tva${randomServer}.sinaimg.cn/` + size + '/' + img;
27
+ }
28
+ };
12
29
  if (count && count > 1) {
13
- const arr = new Array(count)
14
- for (i = 0; i < arr.length; i++) {
15
- arr[i] = image_server + '?' + Math.floor(Math.random() * 999999)
16
- }
17
-
18
- return arr
30
+ const shuffled = image_list.slice(0);
31
+ i = image_list.length;
32
+ const min = i - count;
33
+ let temp;
34
+ let index;
35
+ while (i-- > min) {
36
+ index = Math.floor((i + 1) * Math.random());
37
+ temp = shuffled[index];
38
+ shuffled[index] = shuffled[i];
39
+ shuffled[i] = temp;
40
+ }
41
+ return shuffled.slice(min).map(function (img) {
42
+ return parseImage(img, 'large');
43
+ });
19
44
  }
20
-
21
- return image_server + '?' + Math.floor(Math.random() * 999999)
22
- }
23
-
24
- const parseImage = function (img, size) {
25
- if (img.startsWith('//') || img.startsWith('http')) {
26
- return img
27
- } else if (hexo.theme.config.experiments?.usingRelative) { // support relative url
28
- return img
29
- } else {
30
- console.warn("sinaimg blocked all request from outside website,so don't use this format")
31
- return `https://tva${randomServer}.sinaimg.cn/` + size + '/' + img
45
+ return parseImage(image_list[Math.floor(Math.random() * image_list.length)], 'mw690');
46
+ };
47
+ hexo.extend.helper.register('_url', function (path, text, options = {}) {
48
+ if (!path) {
49
+ return;
32
50
  }
33
- }
34
-
35
- if (count && count > 1) {
36
- const shuffled = image_list.slice(0)
37
- i = image_list.length
38
- const min = i - count; let temp; let index
39
- while (i-- > min) {
40
- index = Math.floor((i + 1) * Math.random())
41
- temp = shuffled[index]
42
- shuffled[index] = shuffled[i]
43
- shuffled[i] = temp
51
+ const { config } = this;
52
+ const data = new URL(path, hexo.config.url);
53
+ const siteHost = new URL(config.url).hostname || config.url;
54
+ const theme = hexo.theme.config;
55
+ let exturl = '';
56
+ let tag = 'a';
57
+ let attrs = { href: hexo_util_1.url_for.call(this, path), class: undefined, external: undefined, rel: undefined, 'data-url': undefined };
58
+ if (theme.exturl && data.protocol && data.hostname !== siteHost) {
59
+ tag = 'span';
60
+ exturl = 'exturl';
61
+ const encoded = Buffer.from(path).toString('base64');
62
+ attrs = {
63
+ class: exturl,
64
+ 'data-url': encoded
65
+ };
44
66
  }
45
-
46
- return shuffled.slice(min).map(function (img) {
47
- return parseImage(img, 'large')
48
- })
49
- }
50
-
51
- return parseImage(image_list[Math.floor(Math.random() * image_list.length)], 'mw690')
52
- }
53
-
54
- // 注册hexo主题中的URL帮助方法
55
- hexo.extend.helper.register('_url', function (path, text, options = {}) {
56
- // 如果未提供URL路径,则返回
57
- if (!path) { return }
58
-
59
- // 获取hexo配置和URL路径信息
60
- const { config } = this
61
- const data = new URL(path, hexo.config.url)
62
- const siteHost = new URL(config.url).hostname || config.url
63
-
64
- // 获取主题配置
65
- const theme = hexo.theme.config
66
- let exturl = ''
67
- let tag = 'a'
68
- let attrs = { href: url_for.call(this, path) }
69
-
70
- // 如果启用了 `exturl`,则只为外部链接设置spanned链接。
71
- if (theme.exturl && data.protocol && data.hostname !== siteHost) {
72
- tag = 'span'
73
- exturl = 'exturl'
74
- // 编码URL字符串,并将其存储在数据属性中。
75
- const encoded = Buffer.from(path).toString('base64')
76
- attrs = {
77
- class: exturl,
78
- 'data-url': encoded
67
+ for (const key in options) {
68
+ if (exturl !== '' && key === 'class') {
69
+ attrs[key] += ' ' + options[key];
70
+ }
71
+ else {
72
+ attrs[key] = options[key];
73
+ }
79
74
  }
80
- }
81
-
82
- for (const key in options) {
83
- /**
84
- * 如果选项包含 `class` 属性,则将其添加到 `exturl` 类中(如果启用了 `exturl` 选项)。
85
- * 否则,将其添加到属性集中。
86
- */
87
- if (exturl !== '' && key === 'class') {
88
- attrs[key] += ' ' + options[key]
89
- } else {
90
- attrs[key] = options[key]
75
+ if (attrs.class && Array.isArray(attrs.class)) {
76
+ attrs.class = attrs.class.join(' ');
91
77
  }
92
- }
93
-
94
- if (attrs.class && Array.isArray(attrs.class)) {
95
- attrs.class = attrs.class.join(' ')
96
- }
97
-
98
- // 如果是外部链接,则重写属性
99
- if (data.protocol && data.hostname !== siteHost) {
100
- attrs.external = null
101
-
102
- if (!theme.exturl) {
103
- // 仅需要为简单链接重写/添加属性。
104
- attrs.rel = 'noopener'
105
- attrs.target = '_blank'
106
- } else {
107
- // 在主菜单中移除 `exturl` 的 rel 属性。
108
- attrs.rel = null
78
+ if (data.protocol && data.hostname !== siteHost) {
79
+ attrs.external = null;
80
+ if (!theme.exturl) {
81
+ attrs.rel = 'noopener';
82
+ attrs.target = '_blank';
83
+ }
84
+ else {
85
+ attrs.rel = null;
86
+ }
109
87
  }
110
- }
111
-
112
- // 返回HTML标记字符串
113
- return htmlTag(tag, attrs, decodeURI(text), false)
114
- })
115
-
88
+ return (0, hexo_util_1.htmlTag)(tag, attrs, decodeURI(text), false);
89
+ });
116
90
  hexo.extend.helper.register('_image_url', function (img, path = '') {
117
- const { statics } = hexo.theme.config
118
- const { post_asset_folder } = hexo.config
119
-
120
- if (img.startsWith('//') || img.startsWith('http')) {
121
- return img
122
- } else {
123
- return url_for.call(this, statics + (post_asset_folder ? path : '') + img)
124
- }
125
- })
126
-
91
+ const { statics } = hexo.theme.config;
92
+ const { post_asset_folder } = hexo.config;
93
+ if (img.startsWith('//') || img.startsWith('http')) {
94
+ return img;
95
+ }
96
+ else {
97
+ return hexo_util_1.url_for.call(this, statics + (post_asset_folder ? path : '') + img);
98
+ }
99
+ });
127
100
  hexo.extend.helper.register('_cover', function (item, num) {
128
- const { image_server, image_list } = hexo.theme.config
129
-
130
- if (item.cover) {
131
- return this._image_url(item.cover, item.path)
132
- } else if (item.photos && item.photos.length > 0) {
133
- return this._image_url(item.photos[0], item.path)
134
- } else {
135
- return randomBG(num || 1, image_server, image_list)
136
- }
137
- })
138
-
139
- // 注册hexo主题的永久链接帮助方法
101
+ const { image_server, image_list } = hexo.theme.config;
102
+ if (item.cover) {
103
+ return this._image_url(item.cover, item.path);
104
+ }
105
+ else if (item.photos && item.photos.length > 0) {
106
+ return this._image_url(item.photos[0], item.path);
107
+ }
108
+ else {
109
+ return randomBG(num || 1, image_server, image_list);
110
+ }
111
+ });
140
112
  hexo.extend.helper.register('_permapath', function (str) {
141
- // 获取hexo的永久链接配置
142
- const { permalink } = hexo.config
143
- // 将输入字符串中的'index.html'替换为空字符串
144
- let url = str.replace(/index\.html$/, '')
145
- // 如果永久链接不以'.html'结尾,将输入字符串中的'.html'替换为空字符串
146
- if (!permalink.endsWith('.html')) {
147
- url = url.replace(/\.html$/, '')
148
- }
149
- // 返回处理后的URL字符串
150
- return url
151
- })
152
-
113
+ const { permalink } = hexo.config;
114
+ let url = str.replace(/index\.html$/, '');
115
+ if (!permalink.endsWith('.html')) {
116
+ url = url.replace(/\.html$/, '');
117
+ }
118
+ return url;
119
+ });
153
120
  hexo.extend.helper.register('canonical', function () {
154
- return `<link rel="canonical" href="${this._permapath(this.url)}">`
155
- })
156
-
157
- /**
158
- * Get page path given a certain language tag
159
- */
160
- // 注册hexo主题的国际化路径帮助方法
121
+ return `<link rel="canonical" href="${this._permapath(this.url)}">`;
122
+ });
161
123
  hexo.extend.helper.register('i18n_path', function (language) {
162
- // 获取当前页面的pathlang
163
- const { path, lang } = this.page
164
- // 如果path以lang开头,则截取掉lang部分,作为基础路径
165
- const base = path.startsWith(lang) ? path.slice(lang.length + 1) : path
166
- // 通过调用url_for方法,生成国际化路径
167
- return url_for.call(this, `${this.languages.indexOf(language) === 0 ? '' : '/' + language}/${base}`)
168
- })
169
-
170
- /**
171
- * Get the language name
172
- */
173
- // 注册hexo主题的语言名称帮助方法
124
+ const { path, lang } = this.page;
125
+ const base = path.startsWith(lang) ? path.slice(lang.length + 1) : path;
126
+ return hexo_util_1.url_for.call(this, `${this.languages.indexOf(language) === 0 ? '' : '/' + language}/${base}`);
127
+ });
174
128
  hexo.extend.helper.register('language_name', function (language) {
175
- // 从主题配置中获取指定语言的名称
176
- const name = hexo.theme.i18n.__(language)('name')
177
- // 如果名称为默认值'name',则返回语言代码,否则返回语言名称
178
- return name === 'name' ? language : name
179
- })
180
-
129
+ const name = hexo.theme.i18n.__(language)('name');
130
+ return name === 'name' ? language : name;
131
+ });
181
132
  hexo.extend.helper.register('random_color', function () {
182
- /**
183
- @type {number[]}
184
- */
185
- const arr = []
186
- for (let i = 0; i < 3; i++) {
187
- arr.push(Math.floor(Math.random() * 128 + 128))
188
- }
189
- const [r, g, b] = arr
190
- return `#${
191
- r.toString(16).length > 1 ? r.toString(16) : '0' + r.toString(16)
192
- }${g.toString(16).length > 1 ? g.toString(16) : '0' + g.toString(16)}${
193
- b.toString(16).length > 1 ? b.toString(16) : '0' + b.toString(16)
194
- }`
195
- })
196
-
133
+ const arr = [];
134
+ for (let i = 0; i < 3; i++) {
135
+ arr.push(Math.floor(Math.random() * 128 + 128));
136
+ }
137
+ const [r, g, b] = arr;
138
+ return `#${r.toString(16).length > 1 ? r.toString(16) : '0' + r.toString(16)}${g.toString(16).length > 1 ? g.toString(16) : '0' + g.toString(16)}${b.toString(16).length > 1 ? b.toString(16) : '0' + b.toString(16)}`;
139
+ });
197
140
  hexo.extend.helper.register('shokax_inject', function (point) {
198
- return hexo.theme.config.injects[point]
199
- .map(item => this.partial(item.layout, item.locals, item.options))
200
- .join('')
201
- })
141
+ return hexo.theme.config.injects[point]
142
+ .map(item => this.partial(item.layout, item.locals, item.options))
143
+ .join('');
144
+ });