From 03618d2ae7ecde73fd8338caad3f733679e70e9b Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Fri, 9 Dec 2022 17:27:59 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=AF=BC=E8=88=AA=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/notion/getNotionData.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/notion/getNotionData.js b/lib/notion/getNotionData.js index 50c84696..11913b2d 100644 --- a/lib/notion/getNotionData.js +++ b/lib/notion/getNotionData.js @@ -215,6 +215,9 @@ async function getPageRecordMapByNotionAPI({ pageId, from }) { // 读取映射 配置 let postCount = 0 + // 获取page作为自定义菜单 + const customNav = getCustomNav({ allPages: collectionData.filter(post => post.type === 'Page' && post.status === 'Published') }) + const allPages = collectionData.filter(post => { if (post.type === 'Post' && post.status === 'Published') { postCount++ @@ -236,7 +239,6 @@ async function getPageRecordMapByNotionAPI({ pageId, from }) { }) } - const customNav = getCustomNav({ allPages }) const categories = getAllCategories({ allPages, categoryOptions, sliceCount: BLOG.PREVIEW_CATEGORY_COUNT }) const tags = getAllTags({ allPages, sliceCount: BLOG.PREVIEW_TAG_COUNT, tagOptions }) const latestPosts = getLatestPosts({ allPages, from, latestPostCount: 5 }) From cecc4de8df2f18830a5ebad471d737a997e0ac6c Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Fri, 9 Dec 2022 22:17:06 +0800 Subject: [PATCH 2/4] medium-beautify --- themes/medium/LayoutArchive.js | 2 +- themes/medium/LayoutBase.js | 2 +- themes/medium/LayoutCategoryIndex.js | 2 +- themes/medium/LayoutTagIndex.js | 2 +- themes/medium/components/BlogPostCard.js | 2 +- themes/medium/components/TopNavBar.js | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/themes/medium/LayoutArchive.js b/themes/medium/LayoutArchive.js index 2f4abb2a..78c73360 100644 --- a/themes/medium/LayoutArchive.js +++ b/themes/medium/LayoutArchive.js @@ -24,7 +24,7 @@ export const LayoutArchive = props => { }) return ( -
+
{Object.keys(archivePosts).map(archiveTitle => (
{
{/* 移动端顶部菜单 */} -
+
{slotTop} {children}
diff --git a/themes/medium/LayoutCategoryIndex.js b/themes/medium/LayoutCategoryIndex.js index 5dc91f81..745c2c78 100644 --- a/themes/medium/LayoutCategoryIndex.js +++ b/themes/medium/LayoutCategoryIndex.js @@ -6,7 +6,7 @@ export const LayoutCategoryIndex = (props) => { const { categories } = props const { locale } = useGlobal() return -
+
{locale.COMMON.CATEGORY}:
diff --git a/themes/medium/LayoutTagIndex.js b/themes/medium/LayoutTagIndex.js index 2c754495..1667dc63 100644 --- a/themes/medium/LayoutTagIndex.js +++ b/themes/medium/LayoutTagIndex.js @@ -7,7 +7,7 @@ export const LayoutTagIndex = props => { const { locale } = useGlobal() return ( -
+
{locale.COMMON.TAGS}: diff --git a/themes/medium/components/BlogPostCard.js b/themes/medium/components/BlogPostCard.js index 9ad4c46c..7cbadf83 100644 --- a/themes/medium/components/BlogPostCard.js +++ b/themes/medium/components/BlogPostCard.js @@ -15,7 +15,7 @@ const BlogPostCard = ({ post, showSummary }) => { key={post.id} className="animate__animated animate__fadeIn duration-300 mb-6 max-w-7xl border-b dark:border-gray-800 " > -
+
{/* 折叠菜单 */} -
+
-
+
{/* 图标Logo */} From 9932eae380e38c26e3edbbb8a12a5047e705dd96 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Fri, 9 Dec 2022 22:27:31 +0800 Subject: [PATCH 3/4] card-dark-mode-color --- styles/notion.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/styles/notion.css b/styles/notion.css index c85608a9..92acdb96 100644 --- a/styles/notion.css +++ b/styles/notion.css @@ -1993,3 +1993,7 @@ thead, tbody tr { width:100%; table-layout:fixed; } + +.notion-collection-card{ + @apply dark:hover:text-gray-200 +} \ No newline at end of file From a8d4ae31e46645d949e3fc3d0b0a8758f7a3bf4d Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Sat, 10 Dec 2022 15:25:52 +0800 Subject: [PATCH 4/4] =?UTF-8?q?next=E4=B8=BB=E9=A2=98=E4=BE=A7=E8=BE=B9?= =?UTF-8?q?=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/fukasawa/config_fuka.js | 1 - themes/medium/config_medium.js | 1 - themes/next/components/MenuButtonGroup.js | 3 +-- themes/next/config_next.js | 1 - 4 files changed, 1 insertion(+), 5 deletions(-) diff --git a/themes/fukasawa/config_fuka.js b/themes/fukasawa/config_fuka.js index 777ecf18..a10fe869 100644 --- a/themes/fukasawa/config_fuka.js +++ b/themes/fukasawa/config_fuka.js @@ -4,7 +4,6 @@ const FUKA_CONFIG = { POST_LIST_PREVIEW: false, // 显示文章预览 // 菜单 - MENU_ABOUT: true, // 显示关于 MENU_CATEGORY: true, // 显示分类 MENU_TAG: true, // 显示标签 MENU_ARCHIVE: true, // 显示归档 diff --git a/themes/medium/config_medium.js b/themes/medium/config_medium.js index 23d6ac52..66fbc948 100644 --- a/themes/medium/config_medium.js +++ b/themes/medium/config_medium.js @@ -9,7 +9,6 @@ const CONFIG_MEDIUM = { POST_DETAIL_TAG: true, // 文章显示标签 // 菜单 - MENU_ABOUT: true, // 显示关于 MENU_CATEGORY: true, // 显示分类 MENU_TAG: true, // 显示标签 MENU_ARCHIVE: true, // 显示归档 diff --git a/themes/next/components/MenuButtonGroup.js b/themes/next/components/MenuButtonGroup.js index b6930e5f..0afb83be 100644 --- a/themes/next/components/MenuButtonGroup.js +++ b/themes/next/components/MenuButtonGroup.js @@ -14,8 +14,7 @@ const MenuButtonGroup = (props) => { { icon: 'fas fa-home', name: locale.NAV.INDEX, to: '/' || '/', show: true }, { icon: 'fas fa-th', name: locale.COMMON.CATEGORY, to: '/category', show: CONFIG_NEXT.MENU_CATEGORY }, { icon: 'fas fa-tag', name: locale.COMMON.TAGS, to: '/tag', show: CONFIG_NEXT.MENU_TAG }, - { icon: 'fas fa-archive', name: locale.NAV.ARCHIVE, to: '/archive', slot: archiveSlot, show: CONFIG_NEXT.MENU_ARCHIVE }, - { icon: 'fas fa-user', name: locale.NAV.ABOUT, to: '/about', show: CONFIG_NEXT.MENU_ABOUT } + { icon: 'fas fa-archive', name: locale.NAV.ARCHIVE, to: '/archive', slot: archiveSlot, show: CONFIG_NEXT.MENU_ARCHIVE } ] let links = [].concat(defaultLinks) if (customNav) { diff --git a/themes/next/config_next.js b/themes/next/config_next.js index 37839b08..1368d436 100644 --- a/themes/next/config_next.js +++ b/themes/next/config_next.js @@ -23,7 +23,6 @@ const CONFIG_NEXT = { MENU_CATEGORY: true, // 显示分类 MENU_TAG: true, // 显示标签 MENU_ARCHIVE: true, // 显示归档 - MENU_ABOUT: false, // 显示关于 MENU_SEARCH: true, // 显示搜索 WIDGET_TO_TOP: true, // 是否显示回顶