Merge branch 'tangly1024:main' into main

This commit is contained in:
yakiisama
2025-06-17 11:27:22 +08:00
committed by GitHub
3 changed files with 11 additions and 7 deletions

View File

@@ -1,8 +1,13 @@
/**
* 读取Notion相关的配置
* 如果需要在Notion中添加自定义字段可以修改此文件
* 此文件内容可以通过环境变量覆盖但是不支持用NOTION_CONFIG覆盖
*/
module.exports = {
// Notion数据库索引取notion的第几个视图作为站点数据和排序依据
NOTION_INDEX: process.env.NEXT_PUBLIC_NOTION_INDEX || 0, // 默认取Notion数据库中的第1个视图
// 由于计算机是从0开始计数、而非从1开始。因此如果要取第二个视图可以传1取第三个视图传2以此类推,取数据库的最后一个视图可以传-1。
// 自定义配置notion数据库字段名
NOTION_PROPERTY_NAME: {
password: process.env.NEXT_PUBLIC_NOTION_PROPERTY_PASSWORD || 'password',

View File

@@ -1,13 +1,14 @@
import BLOG from "@/blog.config"
export default function getAllPageIds (collectionQuery, collectionId, collectionView, viewIds) {
if (!collectionQuery && !collectionView) {
return []
}
// 优先按照第一个视图排序
let pageIds = []
try {
// Notion数据库中的第几个视图用于站点展示和排序
const groupIndex = BLOG.NOTION_INDEX || 0
if (viewIds && viewIds.length > 0) {
const groupIndex = viewIds.length > 0 ? viewIds.length - 1 : 0
const ids = collectionQuery[collectionId][viewIds[groupIndex]]?.collection_group_results?.blockIds || []
for (const id of ids) {
pageIds.push(id)

View File

@@ -116,11 +116,9 @@ const Style = () => {
.dark #theme-hexo .dark\:bg-indigo-500 {
background-color: var(--theme-color) !important;
}
/* 移动设备菜单栏背景色 */
#theme-hexo .hover\:bg-indigo-500:hover {
background-color: var(--theme-color) !important;
}
.dark #theme-hexo .dark\:hover\:bg-indigo-500:hover {
// 移动设备菜单栏选中背景色
#theme-hexo div[class*='hover:bg-indigo-500']:hover {
background-color: var(--theme-color) !important;
}