Skip to content

Commit 30d8e76

Browse files
authored
Merge pull request tangly1024#3121 from tangly1024/release/4.8.1
Release/4.8.1
2 parents bb612de + 2ea797f commit 30d8e76

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

blog.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ const BLOG = {
2828
// 原配置文件过长,且并非所有人都会用到,故此将配置拆分到/conf/目录下, 按需找到对应文件并修改即可
2929
...require('./conf/comment.config'), // 评论插件
3030
...require('./conf/contact.config'), // 作者联系方式配置
31+
...require('./conf/post.config'), // 文章与列表配置
3132
...require('./conf/analytics.config'), // 站点访问统计
32-
...require('./conf/post.config'), // 博客列表数量、文章url相关配置
3333
...require('./conf/image.config'), // 网站图片相关配置
3434
...require('./conf/font.config'), // 网站字体
3535
...require('./conf/right-click-menu'), // 自定义右键菜单相关配置

conf/post.config.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* 博客列表相关配置
2+
* 文章相关功能
33
*/
44
module.exports = {
55
// 文章URL前缀
@@ -9,6 +9,9 @@ module.exports = {
99
// 支援類似 WP 可自訂文章連結格式的功能:https://wordpress.org/documentation/article/customize-permalinks/,目前只先實作 %year%/%month%/%day%
1010
// 例:如想連結改成前綴 article + 時間戳記,可變更為: 'article/%year%/%month%/%day%'
1111

12+
POST_SCHEDULE_PUBLISH:
13+
process.env.NEXT_PUBLIC_NOTION_SCHEDULE_PUBLISH || true, // 按照文章的发布时间字段,控制自动上下架
14+
1215
// 分享条
1316
POST_SHARE_BAR_ENABLE: process.env.NEXT_PUBLIC_POST_SHARE_BAR || 'true', //文章底部分享条开关
1417
POSTS_SHARE_SERVICES:

lib/config.js

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export const siteConfig = (key, defaultVal = null, extendConfig = {}) => {
3434
case 'POST_LIST_STYLE':
3535
case 'POST_LIST_PREVIEW':
3636
case 'POST_URL_PREFIX_MAPPING_CATEGORY':
37+
case 'POST_SCHEDULE_PUBLISH':
3738
case 'IS_TAG_COLOR_DISTINGUISHED':
3839
case 'TAG_SORT_BY_COUNT':
3940
case 'THEME':

lib/db/getSiteData.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ async function convertNotionToSiteDate(pageId, from, pageRecordMap) {
238238

239239
// 新特性,判断文章的发布和下架时间,如果不在有效期内则进行下架处理
240240
const publish = isInRange(post.date)
241-
if (!publish) {
241+
if (!publish && siteConfig('POST_SCHEDULE_PUBLISH', '', NOTION_CONFIG)) {
242242
console.log(post.title, '未处于发布时段 [', post.date, '] 内,将强制隐藏')
243243
// 隐藏
244244
post.status = 'Invisible'

0 commit comments

Comments
 (0)