From 18e52c6352d69191a8283cb7d1daea5616153820 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Mon, 26 Dec 2022 21:44:02 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E5=BE=AE=E8=B0=83?= =?UTF-8?q?=EF=BC=8C=E4=B8=BB=E9=A2=98=E5=88=87=E6=8D=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/ThemeSwitch.js | 18 +++++++-- themes/matery/LayoutCategory.js | 33 ++++++++++++++--- themes/matery/LayoutCategoryIndex.js | 49 ++++++++++++------------- themes/matery/LayoutTag.js | 8 ++-- themes/matery/components/ArticleInfo.js | 5 +-- themes/matery/components/WordCount.js | 13 ++++--- 6 files changed, 78 insertions(+), 48 deletions(-) diff --git a/components/ThemeSwitch.js b/components/ThemeSwitch.js index 9ec3394d..4e84f36f 100644 --- a/components/ThemeSwitch.js +++ b/components/ThemeSwitch.js @@ -1,4 +1,5 @@ import { useGlobal } from '@/lib/global' +import { ALL_THEME } from '@/themes' import React from 'react' import { Draggable } from './Draggable' /** @@ -6,15 +7,24 @@ import { Draggable } from './Draggable' * @returns 主题切换 */ export function ThemeSwitch() { - const { theme, switchTheme } = useGlobal() + const { theme, changeTheme } = useGlobal() + + const onSelectChange = (e) => { + changeTheme(e.target.value) + } return (<>
- -
{theme}
- + + {/*
{theme}
*/} +
diff --git a/themes/matery/LayoutCategory.js b/themes/matery/LayoutCategory.js index 12abfa10..d7c72799 100644 --- a/themes/matery/LayoutCategory.js +++ b/themes/matery/LayoutCategory.js @@ -2,14 +2,35 @@ import BlogPostListScroll from './components/BlogPostListScroll' import BlogPostListPage from './components/BlogPostListPage' import LayoutBase from './LayoutBase' import BLOG from '@/blog.config' +import Link from 'next/link' +import HeaderArticle from './components/HeaderArticle' export const LayoutCategory = props => { - const { category } = props - return -
- - {category} + const { category, categories } = props + return } > + +
+ +
+ +
+ {categories.map(e => { + const selected = e.name === category + return ( + +
+ + {e.name}({e.count}) +
+ + ) + })} +
+
+ + {BLOG.POST_LIST_STYLE === 'page' ? : } +
- {BLOG.POST_LIST_STYLE === 'page' ? : } +
} diff --git a/themes/matery/LayoutCategoryIndex.js b/themes/matery/LayoutCategoryIndex.js index 6d21da03..99c0f582 100644 --- a/themes/matery/LayoutCategoryIndex.js +++ b/themes/matery/LayoutCategoryIndex.js @@ -1,35 +1,32 @@ -import { useGlobal } from '@/lib/global' import Link from 'next/link' -import Card from './components/Card' +import HeaderArticle from './components/HeaderArticle' import LayoutBase from './LayoutBase' export const LayoutCategoryIndex = props => { const { categories } = props - const { locale } = useGlobal() + return ( - - -
- - {locale.COMMON.CATEGORY}: -
-
- {categories.map(category => { - return ( - -
- - {category.name}({category.count}) + } > + +
+ +
+ +
+ {categories.map(e => { + return ( + +
+ + {e.name}({e.count}) +
+ + ) + })} +
- - ) - })} -
- -
+ +
+ ) } diff --git a/themes/matery/LayoutTag.js b/themes/matery/LayoutTag.js index 5e26addd..3f3d4fbd 100644 --- a/themes/matery/LayoutTag.js +++ b/themes/matery/LayoutTag.js @@ -14,9 +14,9 @@ export const LayoutTag = (props) => { return } > -
+
-
+
{locale.COMMON.TAGS} @@ -33,8 +33,10 @@ export const LayoutTag = (props) => { })}
+ + {BLOG.POST_LIST_STYLE === 'page' ? : } +
- {BLOG.POST_LIST_STYLE === 'page' ? : } } diff --git a/themes/matery/components/ArticleInfo.js b/themes/matery/components/ArticleInfo.js index fd21e660..892e1c3e 100644 --- a/themes/matery/components/ArticleInfo.js +++ b/themes/matery/components/ArticleInfo.js @@ -28,15 +28,14 @@ export const ArticleInfo = (props) => { passHref > - 发布日期: {date} + 发布日期: {date} 更新日期: {post.lastEditedTime} - - + )} diff --git a/themes/matery/components/WordCount.js b/themes/matery/components/WordCount.js index 783e37c9..be39bff6 100644 --- a/themes/matery/components/WordCount.js +++ b/themes/matery/components/WordCount.js @@ -10,14 +10,15 @@ export default function WordCount() { }) return - - - 文章字数 - 0 - + + + 文章字数  + 0 + + 阅读时长: - 0 分钟 + 0分钟 } From 39ce6b7e2e07f21b69162d73ed5431905fc82bcb Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Mon, 26 Dec 2022 21:44:53 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=B8=BB=E9=A2=98=20=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/index.js b/themes/index.js index 7f45be48..386a45dc 100644 --- a/themes/index.js +++ b/themes/index.js @@ -9,5 +9,5 @@ import * as nobelium from './nobelium' import * as matery from './matery' import * as example from './example' -export const ALL_THEME = ['hexo', 'next', 'medium', 'fukasawa', 'nobelium', 'matery', 'example'] +export const ALL_THEME = ['hexo', 'matery', 'next', 'medium', 'fukasawa', 'nobelium', 'example'] export { hexo, next, medium, fukasawa, nobelium, matery, example } From f34600dc66b5893a014357ceb5797126845f0bc1 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Mon, 26 Dec 2022 21:49:46 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/hexo/components/BlogPostCard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/hexo/components/BlogPostCard.js b/themes/hexo/components/BlogPostCard.js index 6e617b90..06f4d8c7 100644 --- a/themes/hexo/components/BlogPostCard.js +++ b/themes/hexo/components/BlogPostCard.js @@ -86,7 +86,7 @@ const BlogPostCard = ({ post, showSummary }) => { {CONFIG_HEXO.POST_LIST_COVER && !showPreview && post?.page_cover && !post.results && ( -
+
{/* eslint-disable-next-line @next/next/no-img-element */} Date: Mon, 26 Dec 2022 21:56:19 +0800 Subject: [PATCH 4/4] 3.7.1 --- .env.local | 2 +- package.json | 2 +- styles/notion.css | 4 ++++ themes/hexo/LayoutBase.js | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.env.local b/.env.local index 0c69e3c2..2450afdd 100644 --- a/.env.local +++ b/.env.local @@ -1,2 +1,2 @@ # 环境变量 @see https://www.nextjs.cn/docs/basic-features/environment-variables -NEXT_PUBLIC_VERSION=3.7.0 +NEXT_PUBLIC_VERSION=3.7.1 diff --git a/package.json b/package.json index 51237fd9..7540f8ab 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "notion-next", - "version": "3.7.0", + "version": "3.7.1", "homepage": "https://github.com/tangly1024/NotionNext.git", "license": "MIT", "repository": { diff --git a/styles/notion.css b/styles/notion.css index e7ab6173..2bb4470a 100644 --- a/styles/notion.css +++ b/styles/notion.css @@ -1981,3 +1981,7 @@ pre[class*="language-mermaid"] { code.language-mermaid { display:none } + +.code-toolbar{ + @apply w-full; +} \ No newline at end of file diff --git a/themes/hexo/LayoutBase.js b/themes/hexo/LayoutBase.js index 06399f52..cf438314 100644 --- a/themes/hexo/LayoutBase.js +++ b/themes/hexo/LayoutBase.js @@ -71,7 +71,7 @@ const LayoutBase = props => { id="container-inner" className="pt-14 w-full mx-auto lg:flex lg:space-x-4 justify-center" > -
+
{onLoading ? : children}