Merge pull request #3121 from tangly1024/release/4.8.1

Release/4.8.1
This commit is contained in:
tangly1024
2025-01-05 20:02:42 +08:00
committed by GitHub
4 changed files with 7 additions and 3 deletions

View File

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

View File

@@ -1,5 +1,5 @@
/**
* 博客列表相关配置
* 文章相关功能
*/
module.exports = {
// 文章URL前缀
@@ -9,6 +9,9 @@ module.exports = {
// 支援類似 WP 可自訂文章連結格式的功能https://wordpress.org/documentation/article/customize-permalinks/,目前只先實作 %year%/%month%/%day%
// 例:如想連結改成前綴 article + 時間戳記,可變更為: 'article/%year%/%month%/%day%'
POST_SCHEDULE_PUBLISH:
process.env.NEXT_PUBLIC_NOTION_SCHEDULE_PUBLISH || true, // 按照文章的发布时间字段,控制自动上下架
// 分享条
POST_SHARE_BAR_ENABLE: process.env.NEXT_PUBLIC_POST_SHARE_BAR || 'true', //文章底部分享条开关
POSTS_SHARE_SERVICES:

View File

@@ -34,6 +34,7 @@ export const siteConfig = (key, defaultVal = null, extendConfig = {}) => {
case 'POST_LIST_STYLE':
case 'POST_LIST_PREVIEW':
case 'POST_URL_PREFIX_MAPPING_CATEGORY':
case 'POST_SCHEDULE_PUBLISH':
case 'IS_TAG_COLOR_DISTINGUISHED':
case 'TAG_SORT_BY_COUNT':
case 'THEME':

View File

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