文章自动上下架功能调试

This commit is contained in:
tangly1024
2025-01-05 14:57:02 +08:00
parent d708ea38fb
commit ef24a6dbe8
4 changed files with 42 additions and 33 deletions

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

@@ -236,7 +236,7 @@ async function converNotionToSiteDate(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'