Skip to content

Commit 358b64d

Browse files
committed
chore: 兼容 Cannot assign to read only property 'exports'
1 parent 6509358 commit 358b64d

6 files changed

Lines changed: 18 additions & 5 deletions

File tree

.github/workflows/pages-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
uses: actions/github-script@v6
3333
with:
3434
script: |
35-
const config = require('./blog.config.js')
35+
const config = require('./blog.config.cjs')
3636
core.setOutput('userName', config.userName)
3737
core.setOutput('userEmail', config.userEmail)
3838
core.setOutput('baseUrl', config.baseUrl)

blog.config.cjs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module.exports = {
2+
baseUrl: '/blog/',
3+
userName: 'yanyue404', // GitHub 用户名
4+
userEmail: '1656800216@qq.com', // GitHub 用户邮箱
5+
repository: 'blog', // 记录 issue 的仓库名
6+
accessToken: 'MWM2YmE5NmMwODJhODgyYzBiZmM2ZWExNGVhNzFhYjFkZTM4MzcwYw==', // 经过 base64 加密后的 GitHub Token
7+
blogName: 'Just blog and unjust blog', // 给你的博客取个名字
8+
seo: {
9+
title: '闫越的网络日志',
10+
description: 'Just blog and unjust blog',
11+
keywords: '基督徒 | F2E'
12+
}
13+
}

blog.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module.exports = {
1+
export default {
22
baseUrl: '/blog/',
33
userName: 'yanyue404', // GitHub 用户名
44
userEmail: '1656800216@qq.com', // GitHub 用户邮箱

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# 从 blog.config.js 读取配置
44
CONFIG=$(node -e "
5-
const config = require('./blog.config.js');
5+
const config = require('./blog.config.cjs');
66
console.log(JSON.stringify({
77
userName: config.userName,
88
repository: config.repository,

deploy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const { exec, cd, echo } = require('shelljs')
2-
const blogConfig = require('./blog.config')
2+
const blogConfig = require('./blog.config.cjs')
33
/*
44
自动发布 blog 站点
55
*/

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)