Skip to content

Commit ed08e3f

Browse files
committed
style: function naming optimization
1 parent 1bc6a27 commit ed08e3f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

layout/_partial/head.ejs

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@
4242
<% } %>
4343
<% }) %>
4444
<% } %>
45-
<%- exportConfig() %>
45+
<%- exportThemeConfig() %>
4646
</head>
4747

scripts/helpers/export-config.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ const yaml = require('js-yaml')
1010
/**
1111
* Export theme config to js
1212
*/
13-
hexo.extend.helper.register('exportConfig', function () {
13+
hexo.extend.helper.register('exportThemeConfig', function () {
1414
const { config, theme } = this
1515

16-
// ------------------------ export language to js ------------------------
16+
// -------------------------- export languages --------------------------
1717
const languageDir = path.join(__dirname, '../../languages')
1818
let file = fs.readdirSync(languageDir).find((v) => v === `${config.language}.yml`)
1919
file = languageDir + '/' + (file ? file : 'en.yml')
@@ -49,8 +49,8 @@ hexo.extend.helper.register('exportConfig', function () {
4949
version: require('../../package.json').version
5050
}
5151

52-
return `<script id="hexo-configurations">
53-
let KEEP = window.KEEP || {}
52+
return `<script class="keep-theme-configurations">
53+
const KEEP = window.KEEP || {}
5454
KEEP.hexo_config = ${JSON.stringify(hexo_config)}
5555
KEEP.theme_config = ${JSON.stringify(theme_config)}
5656
KEEP.language_ago = ${JSON.stringify(languageContent['ago'])}

0 commit comments

Comments
 (0)