From 762fad1da6b728fda9b300d7a3eeb74f0447bab4 Mon Sep 17 00:00:00 2001 From: Vixcity <2091283625@qq.com> Date: Wed, 1 Feb 2023 12:09:20 +0800 Subject: [PATCH 01/64] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- blog.config.js | 46 +++++++++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/blog.config.js b/blog.config.js index c0fcca5e..2bbd9f85 100644 --- a/blog.config.js +++ b/blog.config.js @@ -1,25 +1,25 @@ // 注: process.env.XX是Vercel的环境变量,配置方式见:https://docs.tangly1024.com/zh/features/personality const BLOG = { // Important page_id!!!Duplicate Template from https://www.notion.so/tanghh/02ab3b8678004aa69e9e415905ef32a5 - NOTION_PAGE_ID: process.env.NOTION_PAGE_ID || '02ab3b8678004aa69e9e415905ef32a5', + NOTION_PAGE_ID: process.env.NOTION_PAGE_ID || 'fb7bf0cd0563410e862e5ee67b8a8d33', PSEUDO_STATIC: false, // 伪静态路径,开启后所有文章URL都以 .html 结尾。 NEXT_REVALIDATE_SECOND: process.env.NEXT_PUBLIC_REVALIDATE_SECOND || 5, // 更新内容缓存间隔 单位(秒);即每个页面有5秒的纯静态期、此期间无论多少次访问都不会抓取notion数据;调大该值有助于节省Vercel资源、同时提升访问速率,但也会使文章更新有延迟。 THEME: process.env.NEXT_PUBLIC_THEME || 'hexo', // 主题, 支持 ['next','hexo',"fukasawa','medium','example'] @see https://preview.tangly1024.com THEME_SWITCH: process.env.NEXT_PUBLIC_THEME_SWITCH || false, // 是否显示切换主题按钮 LANG: 'zh-CN', // e.g 'zh-CN','en-US' see /lib/lang.js for more. - SINCE: 2021, // e.g if leave this empty, current year will be used. - APPEARANCE: 'light', // ['light', 'dark', 'auto'], // light 日间模式 , dark夜间模式, auto根据时间和主题自动夜间模式 + SINCE: 2022, // e.g if leave this empty, current year will be used. + APPEARANCE: 'auto', // ['light', 'dark', 'auto'], // light 日间模式 , dark夜间模式, auto根据时间和主题自动夜间模式 - AUTHOR: 'tangly1024', // 作者 + AUTHOR: 'Vixcity', // 作者 BIO: '一个普通的干饭人🍚', // 作者简介 - LINK: 'https://tangly1024.com', // 网站地址 + LINK: 'https://bolg.vixcitycc.top/', // 网站地址 KEYWORDS: 'Notion, 博客', // 网站关键词 英文逗号隔开 // 社交链接,不需要可留空白,例如 CONTACT_WEIBO:'' - CONTACT_EMAIL: 'mail@tangly1024.com', // 邮箱 + CONTACT_EMAIL: '2091283625@qq.com', // 邮箱 CONTACT_WEIBO: '', // 你的微博个人主页 CONTACT_TWITTER: '', // 你的twitter个人主页 - CONTACT_GITHUB: 'https://github.com/tangly1024', // 你的github个人主页 - CONTACT_TELEGRAM: 'https://t.me/tangly_1024', // 你的telegram 地址 例如 https://t.me/tangly_1024 + CONTACT_GITHUB: 'https://github.com/Vixcity', // 你的github个人主页 + CONTACT_TELEGRAM: '', // 你的telegram 地址 例如 https://t.me/tangly_1024 CONTACT_LINKEDIN: '', // 你的linkedIn 首页 // 网站默认使用PingFangSC及NotoSansSC, @@ -56,35 +56,43 @@ const BLOG = { POST_LIST_PREVIEW: process.env.NEXT_PUBLIC_POST_PREVIEW || 'false', // 是否在列表加载文章预览 POST_PREVIEW_LINES: 12, // 预览博客行数 POST_RECOMMEND_COUNT: 6, // 推荐文章数量 - POSTS_PER_PAGE: 12, // post counts per page - POSTS_SORT_BY: 'notion', // 排序方式 'date'按时间,'notion'由notion控制 + POSTS_PER_PAGE: 10, // post counts per page + POSTS_SORT_BY: 'date', // 排序方式 'date'按时间,'notion'由notion控制 PREVIEW_CATEGORY_COUNT: 16, // 首页最多展示的分类数量,0为不限制 PREVIEW_TAG_COUNT: 16, // 首页最多展示的标签数量,0为不限制 // 鼠标点击烟花特效 - FIREWORKS: process.env.NEXT_PUBLIC_FIREWORKS || false, // 开关 + FIREWORKS: process.env.NEXT_PUBLIC_FIREWORKS || true, // 开关 // 烟花色彩,感谢 https://github.com/Vixcity 提交的色彩 FIREWORKS_COLOR: ['255, 20, 97', '24, 255, 146', '90, 135, 255', '251, 243, 140'], // 樱花飘落特效 - SAKURA: process.env.NEXT_PUBLIC_SAKURA || false, // 开关 + SAKURA: process.env.NEXT_PUBLIC_SAKURA || true, // 开关 // 漂浮线段特效 - NEST: process.env.NEXT_PUBLIC_NEST || false, // 开关 + NEST: process.env.NEXT_PUBLIC_NEST || true, // 开关 // 动态彩带特效 - FLUTTERINGRIBBON: process.env.NEXT_PUBLIC_FLUTTERINGRIBBON || false, // 开关 + FLUTTERINGRIBBON: process.env.NEXT_PUBLIC_FLUTTERINGRIBBON || true, // 开关 // 静态彩带特效 RIBBON: process.env.NEXT_PUBLIC_RIBBON || false, // 开关 // 星空雨特效 黑夜模式才会生效 - STARRY_SKY: process.env.NEXT_PUBLIC_STARRY_SKY || false, // 开关 + STARRY_SKY: process.env.NEXT_PUBLIC_STARRY_SKY || true, // 开关 // 悬浮挂件 WIDGET_PET: process.env.NEXT_PUBLIC_WIDGET_PET || true, // 是否显示宠物挂件 - WIDGET_PET_LINK: 'https://cdn.jsdelivr.net/npm/live2d-widget-model-wanko@1.0.5/assets/wanko.model.json', // 挂件模型地址 @see https://github.com/xiazeyu/live2d-widget-models - WIDGET_PET_SWITCH_THEME: true, // 点击宠物挂件切换博客主题 + WIDGET_PET_LINK: 'https://cdn.jsdelivr.net/npm/live2d-widget-model-unitychan@1.0.5/assets/unitychan.model.json', // 挂件模型地址 @see https://github.com/xiazeyu/live2d-widget-models + // 好看的主题 + // https://cdn.jsdelivr.net/npm/live2d-widget-model-ni-j@1.0.5/assets/ni-j.model.json + // https://cdn.jsdelivr.net/npm/live2d-widget-model-nipsilon@1.0.5/assets/nipsilon.model.json + // https://cdn.jsdelivr.net/npm/live2d-widget-model-nito@1.0.5/assets/nito.model.json + // https://cdn.jsdelivr.net/npm/live2d-widget-model-shizuku@1.0.5/assets/shizuku.model.json + // https://cdn.jsdelivr.net/npm/live2d-widget-model-unitychan@1.0.5/assets/unitychan.model.json + // https://cdn.jsdelivr.net/npm/live2d-widget-model-koharu@1.0.5/assets/koharu.model.json + // https://cdn.jsdelivr.net/npm/live2d-widget-model-haruto@1.0.5/assets/haruto.model.json + WIDGET_PET_SWITCH_THEME: false, // 点击宠物挂件切换博客主题 // 音乐播放插件 MUSIC_PLAYER: process.env.NEXT_PUBLIC_MUSIC_PLAYER || false, // 是否使用音乐播放插件 @@ -191,9 +199,9 @@ const BLOG = { // 作废配置 AVATAR: '/avatar.png', // 作者头像,被notion中的ICON覆盖。若无ICON则取public目录下的avatar.png - TITLE: process.env.NEXT_PUBLIC_TITLE || 'NotionNext BLOG', // 站点标题 ,被notion中的页面标题覆盖 + TITLE: process.env.NEXT_PUBLIC_TITLE || 'VIXCITY BLOG', // 站点标题 ,被notion中的页面标题覆盖 HOME_BANNER_IMAGE: './bg_image.jpg', // 首页背景大图, 会被notion中的封面图覆盖,若无封面图则会使用代码中的 /public/bg_image.jpg 文件 - DESCRIPTION: process.env.NEXT_PUBLIC_DESCRIPTION || '这是一个由NotionNext生成的站点', // 站点描述,被notion中的页面描述覆盖 + DESCRIPTION: process.env.NEXT_PUBLIC_DESCRIPTION || '我的小破博客', // 站点描述,被notion中的页面描述覆盖 // 开发相关 NOTION_ACCESS_TOKEN: process.env.NOTION_ACCESS_TOKEN || '', // Useful if you prefer not to make your database public From 006bb82170915e25193e2a47c9f915dbf20ab8f4 Mon Sep 17 00:00:00 2001 From: Vixcity <2091283625@qq.com> Date: Wed, 1 Feb 2023 14:39:40 +0800 Subject: [PATCH 02/64] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20DIY=20=E5=BC=95?= =?UTF-8?q?=E5=85=A5=20CSS=20=E6=95=B0=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- blog.config.js | 7 +++++-- pages/_document.js | 27 ++++++++++++++++++------- themes/hexo/LayoutSlug.js | 2 +- themes/hexo/components/BlogPostCard.js | 2 +- themes/hexo/components/Card.js | 2 +- themes/hexo/components/Footer.js | 2 +- themes/hexo/components/HeaderArticle.js | 4 ++-- themes/hexo/components/SideRight.js | 2 +- 8 files changed, 32 insertions(+), 16 deletions(-) diff --git a/blog.config.js b/blog.config.js index c0fcca5e..5f3270bf 100644 --- a/blog.config.js +++ b/blog.config.js @@ -71,16 +71,19 @@ const BLOG = { SAKURA: process.env.NEXT_PUBLIC_SAKURA || false, // 开关 // 漂浮线段特效 - NEST: process.env.NEXT_PUBLIC_NEST || false, // 开关 + NEST: process.env.NEXT_PUBLIC_NEST || true, // 开关 // 动态彩带特效 - FLUTTERINGRIBBON: process.env.NEXT_PUBLIC_FLUTTERINGRIBBON || false, // 开关 + FLUTTERINGRIBBON: process.env.NEXT_PUBLIC_FLUTTERINGRIBBON || true, // 开关 // 静态彩带特效 RIBBON: process.env.NEXT_PUBLIC_RIBBON || false, // 开关 // 星空雨特效 黑夜模式才会生效 STARRY_SKY: process.env.NEXT_PUBLIC_STARRY_SKY || false, // 开关 + // 样式代码 + CSS_LIST: [''], + // 悬浮挂件 WIDGET_PET: process.env.NEXT_PUBLIC_WIDGET_PET || true, // 是否显示宠物挂件 WIDGET_PET_LINK: 'https://cdn.jsdelivr.net/npm/live2d-widget-model-wanko@1.0.5/assets/wanko.model.json', // 挂件模型地址 @see https://github.com/xiazeyu/live2d-widget-models diff --git a/pages/_document.js b/pages/_document.js index 4438697e..d963fc40 100644 --- a/pages/_document.js +++ b/pages/_document.js @@ -11,20 +11,33 @@ class MyDocument extends Document { render() { return ( - + - - + + + {console.log(this.renderCSS())} + {this.renderCSS()} - - -
- + +
+ ) } + + renderCSS() { + if (BLOG.CSS_LIST && BLOG.CSS_LIST.length > 0) { + return BLOG.CSS_LIST.map((item, index) => { + return ( + + ) + }) + } + } } export default MyDocument diff --git a/themes/hexo/LayoutSlug.js b/themes/hexo/LayoutSlug.js index 327497ac..7ee0c152 100644 --- a/themes/hexo/LayoutSlug.js +++ b/themes/hexo/LayoutSlug.js @@ -46,7 +46,7 @@ export const LayoutSlug = props => { showTag={false} floatSlot={floatSlot} > -
+
{lock && } {!lock &&
diff --git a/themes/hexo/components/BlogPostCard.js b/themes/hexo/components/BlogPostCard.js index df120154..dcbf6bbd 100644 --- a/themes/hexo/components/BlogPostCard.js +++ b/themes/hexo/components/BlogPostCard.js @@ -14,7 +14,7 @@ const BlogPostCard = ({ post, showSummary }) => { data-aos-easing="ease-in-out" data-aos-once="false" data-aos-anchor-placement="top-bottom" - className="w-full drop-shadow-md border dark:border-black rounded-xl bg-white dark:bg-hexo-black-gray duration-300"> + className="w-full drop-shadow-md border dark:border-black rounded-xl bg-white dark:bg-hexo-black-gray duration-300 coverArticle">
{ return
<>{headerSlot} -
+
{children}
diff --git a/themes/hexo/components/Footer.js b/themes/hexo/components/Footer.js index 3fc42d36..7cefa951 100644 --- a/themes/hexo/components/Footer.js +++ b/themes/hexo/components/Footer.js @@ -14,7 +14,7 @@ const Footer = ({ title }) => { return (
diff --git a/themes/hexo/components/HeaderArticle.js b/themes/hexo/components/HeaderArticle.js index fef4ec74..3256f5d0 100644 --- a/themes/hexo/components/HeaderArticle.js +++ b/themes/hexo/components/HeaderArticle.js @@ -19,7 +19,7 @@ export default function HeaderArticle({ post, siteInfo }) { return (
- ); + ) } diff --git a/themes/hexo/components/SideRight.js b/themes/hexo/components/SideRight.js index 8680f144..5e6da1ec 100644 --- a/themes/hexo/components/SideRight.js +++ b/themes/hexo/components/SideRight.js @@ -22,7 +22,7 @@ export default function SideRight(props) { } = props return ( -
+
{CONFIG_HEXO.WIDGET_ANALYTICS && } From c0c1d0e1a684968c0b48e5835efa7c29bf31a072 Mon Sep 17 00:00:00 2001 From: Vixcity <2091283625@qq.com> Date: Wed, 1 Feb 2023 16:04:53 +0800 Subject: [PATCH 03/64] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- blog.config.js | 49 +++++++++++++++++++------------------------------ 1 file changed, 19 insertions(+), 30 deletions(-) diff --git a/blog.config.js b/blog.config.js index 02866633..2b0c3d28 100644 --- a/blog.config.js +++ b/blog.config.js @@ -1,25 +1,25 @@ // 注: process.env.XX是Vercel的环境变量,配置方式见:https://docs.tangly1024.com/zh/features/personality const BLOG = { // Important page_id!!!Duplicate Template from https://www.notion.so/tanghh/02ab3b8678004aa69e9e415905ef32a5 - NOTION_PAGE_ID: process.env.NOTION_PAGE_ID || 'fb7bf0cd0563410e862e5ee67b8a8d33', + NOTION_PAGE_ID: process.env.NOTION_PAGE_ID || '02ab3b8678004aa69e9e415905ef32a5', PSEUDO_STATIC: false, // 伪静态路径,开启后所有文章URL都以 .html 结尾。 NEXT_REVALIDATE_SECOND: process.env.NEXT_PUBLIC_REVALIDATE_SECOND || 5, // 更新内容缓存间隔 单位(秒);即每个页面有5秒的纯静态期、此期间无论多少次访问都不会抓取notion数据;调大该值有助于节省Vercel资源、同时提升访问速率,但也会使文章更新有延迟。 THEME: process.env.NEXT_PUBLIC_THEME || 'hexo', // 主题, 支持 ['next','hexo',"fukasawa','medium','example'] @see https://preview.tangly1024.com THEME_SWITCH: process.env.NEXT_PUBLIC_THEME_SWITCH || false, // 是否显示切换主题按钮 LANG: 'zh-CN', // e.g 'zh-CN','en-US' see /lib/lang.js for more. - SINCE: 2022, // e.g if leave this empty, current year will be used. - APPEARANCE: 'auto', // ['light', 'dark', 'auto'], // light 日间模式 , dark夜间模式, auto根据时间和主题自动夜间模式 + SINCE: 2021, // e.g if leave this empty, current year will be used. + APPEARANCE: 'light', // ['light', 'dark', 'auto'], // light 日间模式 , dark夜间模式, auto根据时间和主题自动夜间模式 - AUTHOR: 'Vixcity', // 作者 + AUTHOR: 'tangly1024', // 作者 BIO: '一个普通的干饭人🍚', // 作者简介 - LINK: 'https://bolg.vixcitycc.top/', // 网站地址 + LINK: 'https://tangly1024.com', // 网站地址 KEYWORDS: 'Notion, 博客', // 网站关键词 英文逗号隔开 // 社交链接,不需要可留空白,例如 CONTACT_WEIBO:'' - CONTACT_EMAIL: '2091283625@qq.com', // 邮箱 + CONTACT_EMAIL: 'mail@tangly1024.com', // 邮箱 CONTACT_WEIBO: '', // 你的微博个人主页 CONTACT_TWITTER: '', // 你的twitter个人主页 - CONTACT_GITHUB: 'https://github.com/Vixcity', // 你的github个人主页 - CONTACT_TELEGRAM: '', // 你的telegram 地址 例如 https://t.me/tangly_1024 + CONTACT_GITHUB: 'https://github.com/tangly1024', // 你的github个人主页 + CONTACT_TELEGRAM: 'https://t.me/tangly_1024', // 你的telegram 地址 例如 https://t.me/tangly_1024 CONTACT_LINKEDIN: '', // 你的linkedIn 首页 // 网站默认使用PingFangSC及NotoSansSC, @@ -60,46 +60,35 @@ const BLOG = { POST_LIST_PREVIEW: process.env.NEXT_PUBLIC_POST_PREVIEW || 'false', // 是否在列表加载文章预览 POST_PREVIEW_LINES: 12, // 预览博客行数 POST_RECOMMEND_COUNT: 6, // 推荐文章数量 - POSTS_PER_PAGE: 10, // post counts per page - POSTS_SORT_BY: 'date', // 排序方式 'date'按时间,'notion'由notion控制 + POSTS_PER_PAGE: 12, // post counts per page + POSTS_SORT_BY: 'notion', // 排序方式 'date'按时间,'notion'由notion控制 PREVIEW_CATEGORY_COUNT: 16, // 首页最多展示的分类数量,0为不限制 PREVIEW_TAG_COUNT: 16, // 首页最多展示的标签数量,0为不限制 // 鼠标点击烟花特效 - FIREWORKS: process.env.NEXT_PUBLIC_FIREWORKS || true, // 开关 + FIREWORKS: process.env.NEXT_PUBLIC_FIREWORKS || false, // 开关 // 烟花色彩,感谢 https://github.com/Vixcity 提交的色彩 FIREWORKS_COLOR: ['255, 20, 97', '24, 255, 146', '90, 135, 255', '251, 243, 140'], // 樱花飘落特效 - SAKURA: process.env.NEXT_PUBLIC_SAKURA || true, // 开关 + SAKURA: process.env.NEXT_PUBLIC_SAKURA || false, // 开关 // 漂浮线段特效 - NEST: process.env.NEXT_PUBLIC_NEST || true, // 开关 + NEST: process.env.NEXT_PUBLIC_NEST || false, // 开关 // 动态彩带特效 - FLUTTERINGRIBBON: process.env.NEXT_PUBLIC_FLUTTERINGRIBBON || true, // 开关 + FLUTTERINGRIBBON: process.env.NEXT_PUBLIC_FLUTTERINGRIBBON || false, // 开关 // 静态彩带特效 RIBBON: process.env.NEXT_PUBLIC_RIBBON || false, // 开关 // 星空雨特效 黑夜模式才会生效 - STARRY_SKY: process.env.NEXT_PUBLIC_STARRY_SKY || true, // 开关 - - // 样式代码 - CSS_LIST: [''], + STARRY_SKY: process.env.NEXT_PUBLIC_STARRY_SKY || false, // 开关 // 悬浮挂件 WIDGET_PET: process.env.NEXT_PUBLIC_WIDGET_PET || true, // 是否显示宠物挂件 - WIDGET_PET_LINK: 'https://cdn.jsdelivr.net/npm/live2d-widget-model-unitychan@1.0.5/assets/unitychan.model.json', // 挂件模型地址 @see https://github.com/xiazeyu/live2d-widget-models - // 好看的主题 - // https://cdn.jsdelivr.net/npm/live2d-widget-model-ni-j@1.0.5/assets/ni-j.model.json - // https://cdn.jsdelivr.net/npm/live2d-widget-model-nipsilon@1.0.5/assets/nipsilon.model.json - // https://cdn.jsdelivr.net/npm/live2d-widget-model-nito@1.0.5/assets/nito.model.json - // https://cdn.jsdelivr.net/npm/live2d-widget-model-shizuku@1.0.5/assets/shizuku.model.json - // https://cdn.jsdelivr.net/npm/live2d-widget-model-unitychan@1.0.5/assets/unitychan.model.json - // https://cdn.jsdelivr.net/npm/live2d-widget-model-koharu@1.0.5/assets/koharu.model.json - // https://cdn.jsdelivr.net/npm/live2d-widget-model-haruto@1.0.5/assets/haruto.model.json - WIDGET_PET_SWITCH_THEME: false, // 点击宠物挂件切换博客主题 + WIDGET_PET_LINK: 'https://cdn.jsdelivr.net/npm/live2d-widget-model-wanko@1.0.5/assets/wanko.model.json', // 挂件模型地址 @see https://github.com/xiazeyu/live2d-widget-models + WIDGET_PET_SWITCH_THEME: true, // 点击宠物挂件切换博客主题 // 音乐播放插件 MUSIC_PLAYER: process.env.NEXT_PUBLIC_MUSIC_PLAYER || false, // 是否使用音乐播放插件 @@ -206,9 +195,9 @@ const BLOG = { // 作废配置 AVATAR: '/avatar.png', // 作者头像,被notion中的ICON覆盖。若无ICON则取public目录下的avatar.png - TITLE: process.env.NEXT_PUBLIC_TITLE || 'VIXCITY BLOG', // 站点标题 ,被notion中的页面标题覆盖 + TITLE: process.env.NEXT_PUBLIC_TITLE || 'NotionNext BLOG', // 站点标题 ,被notion中的页面标题覆盖 HOME_BANNER_IMAGE: './bg_image.jpg', // 首页背景大图, 会被notion中的封面图覆盖,若无封面图则会使用代码中的 /public/bg_image.jpg 文件 - DESCRIPTION: process.env.NEXT_PUBLIC_DESCRIPTION || '我的小破博客', // 站点描述,被notion中的页面描述覆盖 + DESCRIPTION: process.env.NEXT_PUBLIC_DESCRIPTION || '这是一个由NotionNext生成的站点', // 站点描述,被notion中的页面描述覆盖 // 开发相关 NOTION_ACCESS_TOKEN: process.env.NOTION_ACCESS_TOKEN || '', // Useful if you prefer not to make your database public From a64e3d3dce863b32b98d11cc34aff434ede44c2f Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Sun, 19 Mar 2023 19:06:33 +0800 Subject: [PATCH 04/64] =?UTF-8?q?=E4=BA=8C=E7=BA=A7=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=EF=BC=8C=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/Collapse.js | 49 +++++--- components/FlutteringRibbon.js | 14 ++- components/Nest.js | 17 ++- components/Ribbon.js | 15 ++- components/Sakura.js | 22 ++-- lib/notion/getNotionData.js | 19 ++-- themes/example/components/DropMenu.js | 38 +++++++ themes/example/components/Nav.js | 33 +++--- themes/example/components/NormalMenuItem.js | 14 +++ themes/hexo/components/Collapse.js | 43 ------- themes/hexo/components/TopNav.js | 2 +- themes/matery/components/Collapse.js | 75 ------------ themes/next/components/Collapse.js | 38 ------- themes/next/components/CollapseMenu.js | 54 +++++++++ themes/next/components/DropMenu.js | 35 ++++++ themes/next/components/MenuButtonGroup.js | 48 ++++---- themes/next/components/SideAreaLeft.js | 2 +- themes/next/components/TopNav.js | 119 ++++++++++---------- themes/nobelium/components/DropMenu.js | 38 +++++++ themes/nobelium/components/Nav.js | 25 ++-- themes/simple/LayoutBase.js | 4 +- themes/simple/components/DropMenu.js | 4 +- themes/simple/components/NavBarMenu.js | 4 + 23 files changed, 390 insertions(+), 322 deletions(-) create mode 100644 themes/example/components/DropMenu.js create mode 100644 themes/example/components/NormalMenuItem.js delete mode 100644 themes/hexo/components/Collapse.js delete mode 100644 themes/matery/components/Collapse.js delete mode 100644 themes/next/components/Collapse.js create mode 100644 themes/next/components/CollapseMenu.js create mode 100644 themes/next/components/DropMenu.js create mode 100644 themes/nobelium/components/DropMenu.js diff --git a/components/Collapse.js b/components/Collapse.js index a787bfa2..99629604 100644 --- a/components/Collapse.js +++ b/components/Collapse.js @@ -1,4 +1,4 @@ -import React from 'react' +import React, { useEffect, useImperativeHandle } from 'react' /** * 折叠面板组件,支持水平折叠、垂直折叠 @@ -6,12 +6,27 @@ import React from 'react' * @returns */ const Collapse = props => { - const collapseRef = React.useRef(null) + const { collapseRef } = props + const ref = React.useRef(null) const type = props.type || 'vertical' + + useImperativeHandle(collapseRef, () => { + return { + /** + * 当子元素高度变化时,可调用此方法更新折叠组件的高度 + * @param {*} param0 + */ + updateCollapseHeight: ({ height, increase }) => { + ref.current.style.height = ref.current.scrollHeight + ref.current.style.height = 'auto' + } + } + }) + /** - * 折叠 - * @param {*} element - */ + * 折叠 + * @param {*} element + */ const collapseSection = element => { const sectionHeight = element.scrollHeight const sectionWidth = element.scrollWidth @@ -34,9 +49,9 @@ const Collapse = props => { } /** - * 展开 - * @param {*} element - */ + * 展开 + * @param {*} element + */ const expandSection = element => { const sectionHeight = element.scrollHeight const sectionWidth = element.scrollWidth @@ -58,22 +73,20 @@ const Collapse = props => { clearTimeout(clearTime) } - const updateHeight = () => { - collapseRef.current.style.height = 'auto' - } - - React.useEffect(() => { + useEffect(() => { if (props.isOpen) { - expandSection(collapseRef.current) + expandSection(ref.current) } else { - collapseSection(collapseRef.current) + collapseSection(ref.current) } + // 通知父组件高度变化 + props?.onHeightChange && props.onHeightChange({ height: ref.current.scrollHeight, increase: props.isOpen }) }, [props.isOpen]) return ( -
- {props.children} -
+
+ {props.children} +
) } Collapse.defaultProps = { isOpen: false } diff --git a/components/FlutteringRibbon.js b/components/FlutteringRibbon.js index a615d533..301fbd23 100644 --- a/components/FlutteringRibbon.js +++ b/components/FlutteringRibbon.js @@ -1,10 +1,21 @@ /* eslint-disable */ import React from 'react' - +const id = 'canvasFlutteringRibbon' export const FlutteringRibbon = () => { + const destroyRibbon = ()=>{ + const ribbon = document.getElementById(id) + if(ribbon && ribbon.parentNode){ + ribbon.parentNode.removeChild(ribbon) + } + } + React.useEffect(() => { createFlutteringRibbon() + return () => destroyRibbon() + }, []) + return <> + } /** @@ -125,6 +136,7 @@ function createFlutteringRibbon() { init: function () { try { ;(this._canvas = document.createElement('canvas')), + (this._canvas.id = id), (this._canvas.style.display = 'block'), (this._canvas.style.position = 'fixed'), (this._canvas.style.margin = '0'), diff --git a/components/Nest.js b/components/Nest.js index 781cb2bf..74fa85e3 100644 --- a/components/Nest.js +++ b/components/Nest.js @@ -1,10 +1,19 @@ /* eslint-disable */ -import React from 'react' - +import { useEffect } from 'react' +const id = 'canvasNestCreated' export const Nest = () => { - React.useEffect(() => { + const destroyNest = ()=>{ + const nest = document.getElementById(id) + if(nest && nest.parentNode){ + nest.parentNode.removeChild(nest) + } + } + + useEffect(() => { createNest() + return () => destroyNest() }, []) + return <> } /** @@ -65,7 +74,7 @@ function createNest() { m(o) } var i = document.createElement('canvas') - i.id = 'canvasNestCreated' + i.id = id var a = (function () { const t = e return { diff --git a/components/Ribbon.js b/components/Ribbon.js index d96e3591..2c6855fc 100644 --- a/components/Ribbon.js +++ b/components/Ribbon.js @@ -1,10 +1,20 @@ /* eslint-disable */ -import React from 'react' +import { useEffect } from 'react' +const id = 'canvasRibbon' export const Ribbon = () => { - React.useEffect(() => { + const destroyRibbon = ()=>{ + const ribbon = document.getElementById(id) + if(ribbon && ribbon.parentNode){ + ribbon.parentNode.removeChild(ribbon) + } + } + + useEffect(() => { createRibbon() + return () => destroyRibbon() }, []) + return <> } /** @@ -29,6 +39,7 @@ function createRibbon() { a = window.innerWidth, l = window.innerHeight, d = e.s + i.id= id let r, s const u = Math let h = 0 diff --git a/components/Sakura.js b/components/Sakura.js index 3f69cc25..e814362f 100644 --- a/components/Sakura.js +++ b/components/Sakura.js @@ -1,10 +1,19 @@ /* eslint-disable */ -import React from 'react' - +import { useEffect } from 'react' +const id = 'canvas_sakura' export const Sakura = () => { - React.useEffect(() => { + const destroySakura = ()=>{ + const sakura = document.getElementById(id) + if(sakura && sakura.parentNode){ + sakura.parentNode.removeChild(sakura) + } + } + + useEffect(() => { createSakura({}) + return () => destroyRibbon() }, []) + return <> } /** @@ -129,7 +138,7 @@ function createSakura() { 'style', 'position: fixed;left: 0;top: 0;pointer-events: none;' ) - canvas.setAttribute('id', 'canvas_sakura') + canvas.setAttribute('id', id) document.getElementsByTagName('body')[0].appendChild(canvas) cxt = canvas.getContext('2d') var sakuraList = new SakuraList() @@ -165,15 +174,12 @@ function createSakura() { stop = requestAnimationFrame(asd) } } - window.onresize = function () { - var canvasSnow = document.getElementById('canvas_snow') - } img.onload = function () { startSakura() } function stopp() { if (staticx) { - var child = document.getElementById('canvas_sakura') + var child = document.getElementById(id) child.parentNode.removeChild(child) window.cancelAnimationFrame(stop) staticx = false diff --git a/lib/notion/getNotionData.js b/lib/notion/getNotionData.js index 44d97f2f..e2fcf242 100644 --- a/lib/notion/getNotionData.js +++ b/lib/notion/getNotionData.js @@ -95,8 +95,13 @@ function getCustomNav({ allPages }) { return customNav } -function getCustomMenu({ collectionData }) { - const menuPages = collectionData.filter(post => (post.type === BLOG.NOTION_PROPERTY_NAME.type_menu || post.type === BLOG.NOTION_PROPERTY_NAME.type_sub_menu) && post.status === 'Published') +/** + * 获取自定义菜单 + * @param {*} allPages + * @returns + */ +function getCustomMenu({ allPages }) { + const menuPages = allPages.filter(post => (post.type === BLOG.NOTION_PROPERTY_NAME.type_menu || post.type === BLOG.NOTION_PROPERTY_NAME.type_sub_menu) && post.status === BLOG.NOTION_PROPERTY_NAME.status_publish) const menus = [] if (menuPages && menuPages.length > 0) { menuPages.forEach(e => { @@ -216,14 +221,12 @@ async function getPageRecordMapByNotionAPI({ pageId, from }) { // 文章计数 let postCount = 0 const allPages = collectionData.filter(post => { - if (post.type === 'Post' && post.status === 'Published') { + if (post.type === BLOG.NOTION_PROPERTY_NAME.type_post && post.status === BLOG.NOTION_PROPERTY_NAME.status_publish) { postCount++ } return post && - post.type && - (post.type === 'Post' || post.type === 'Page') && - (post.status === 'Published' || post.status === 'Invisible') && - (!post.slug.startsWith('http')) + (!post?.slug?.startsWith('http')) && + (post?.status === BLOG.NOTION_PROPERTY_NAME.status_publish || post?.status === BLOG.NOTION_PROPERTY_NAME.status_invisible) }) // Sort by date @@ -241,7 +244,7 @@ async function getPageRecordMapByNotionAPI({ pageId, from }) { const siteInfo = getBlogInfo({ collection, block }) const customNav = getCustomNav({ allPages: collectionData.filter(post => post.type === 'Page' && post.status === 'Published') }) // 新的菜单 - const customMenu = getCustomMenu({ collectionData }) + const customMenu = await getCustomMenu({ allPages }) const latestPosts = getLatestPosts({ allPages, from, latestPostCount: 5 }) return { diff --git a/themes/example/components/DropMenu.js b/themes/example/components/DropMenu.js new file mode 100644 index 00000000..f2c2c802 --- /dev/null +++ b/themes/example/components/DropMenu.js @@ -0,0 +1,38 @@ +import Link from 'next/link' +import { useState } from 'react' + +export const DropMenu = ({ link }) => { + const [show, changeShow] = useState(false) + const hasSubMenu = link?.subMenus?.length > 0 + + return
  • changeShow(true)} onMouseOut={() => changeShow(false)} > + + {!hasSubMenu && +
    + + {link?.name} + {hasSubMenu && } + +
    + } + + {hasSubMenu && +
    + {link?.name} + +
    + } + + {/* 子菜单 */} + {hasSubMenu &&
      + {link.subMenus.map(sLink => { + return
    • + + {sLink.title} + +
    • + })} +
    } + +
  • +} diff --git a/themes/example/components/Nav.js b/themes/example/components/Nav.js index 9e05646b..7fa8cf09 100644 --- a/themes/example/components/Nav.js +++ b/themes/example/components/Nav.js @@ -1,6 +1,7 @@ +import BLOG from '@/blog.config' import { useGlobal } from '@/lib/global' -import Link from 'next/link' import CONFIG_EXAMPLE from '../config_example' +import { DropMenu } from './DropMenu' /** * 菜单导航 @@ -8,8 +9,9 @@ import CONFIG_EXAMPLE from '../config_example' * @returns */ export const Nav = (props) => { - const { customNav } = props + const { customNav, customMenu } = props const { locale } = useGlobal() + let links = [ { icon: 'fas fa-search', name: locale.NAV.SEARCH, to: '/search', show: CONFIG_EXAMPLE.MENU_SEARCH }, { icon: 'fas fa-archive', name: locale.NAV.ARCHIVE, to: '/archive', show: CONFIG_EXAMPLE.MENU_ARCHIVE }, @@ -21,23 +23,22 @@ export const Nav = (props) => { links = links.concat(customNav) } + // 如果 开启自定义菜单,则不再使用 Page生成菜单。 + if (BLOG.CUSTOM_MENU) { + links = customMenu + } + + if (!links || links.length === 0) { + return null + } + return ( ) diff --git a/themes/hexo/components/MenuItemDrop.js b/themes/hexo/components/MenuItemDrop.js index 0111c073..12fa81d0 100644 --- a/themes/hexo/components/MenuItemDrop.js +++ b/themes/hexo/components/MenuItemDrop.js @@ -15,13 +15,13 @@ export const MenuItemDrop = ({ link }) => { - {link?.name} + {link?.icon && } {link?.name} {hasSubMenu && } } {hasSubMenu && <>
    - {link?.name} + {link?.icon && } {link?.name}
    } diff --git a/themes/matery/components/MenuItemDrop.js b/themes/matery/components/MenuItemDrop.js index 9eb14386..bff61738 100644 --- a/themes/matery/components/MenuItemDrop.js +++ b/themes/matery/components/MenuItemDrop.js @@ -15,13 +15,13 @@ export const MenuItemDrop = ({ link }) => { - {link?.name} + {link?.icon && } {link?.name} {hasSubMenu && } } {hasSubMenu && <>
    - {link?.name} + {link?.icon && } {link?.name}
    } diff --git a/themes/medium/components/MenuItemDrop.js b/themes/medium/components/MenuItemDrop.js index 1ca515d5..e72ecbaf 100644 --- a/themes/medium/components/MenuItemDrop.js +++ b/themes/medium/components/MenuItemDrop.js @@ -16,22 +16,22 @@ export const MenuItemDrop = ({ link }) => { {hasSubMenu &&
    + (selected ? 'bg-green-600 text-white hover:text-white' : 'hover:text-green-600')}>
    - {link?.name} + {link?.icon && } {link?.name} {hasSubMenu && }
    } {!hasSubMenu && -
    - - {link?.name} - -
    - } +
    + + {link?.icon && } {link?.name} + +
    + } {/* 子菜单 */} {hasSubMenu &&
      diff --git a/themes/nobelium/components/MenuItemDrop.js b/themes/nobelium/components/MenuItemDrop.js index a33a7ec0..18ce2d8c 100644 --- a/themes/nobelium/components/MenuItemDrop.js +++ b/themes/nobelium/components/MenuItemDrop.js @@ -10,7 +10,7 @@ export const MenuItemDrop = ({ link }) => { {!hasSubMenu &&
      - {link?.name} + {link?.icon && } {link?.name} {hasSubMenu && }
      @@ -18,7 +18,7 @@ export const MenuItemDrop = ({ link }) => { {hasSubMenu &&
      - {link?.name} + {link?.icon && } {link?.name}
      } From 7d63762b6272477f365dc6f18d8dcdfd152bfb7a Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Thu, 23 Mar 2023 22:58:33 +0800 Subject: [PATCH 22/64] menu-css --- themes/example/components/MenuItemDrop.js | 4 ++-- themes/hexo/components/MenuItemDrop.js | 2 +- themes/matery/components/MenuItemDrop.js | 2 +- themes/medium/components/MenuItemDrop.js | 2 +- themes/nobelium/components/MenuItemDrop.js | 8 ++++---- themes/simple/components/MenuItemDrop.js | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/themes/example/components/MenuItemDrop.js b/themes/example/components/MenuItemDrop.js index 4100149d..85c350bc 100644 --- a/themes/example/components/MenuItemDrop.js +++ b/themes/example/components/MenuItemDrop.js @@ -10,7 +10,7 @@ export const MenuItemDrop = ({ link }) => { {!hasSubMenu &&
      - {link?.icon && } {link?.name} + {link?.icon && } {link?.name} {hasSubMenu && }
      @@ -28,7 +28,7 @@ export const MenuItemDrop = ({ link }) => { {link.subMenus.map(sLink => { return
    • - {sLink.title} + {link?.icon &&   }{sLink.title}
    • })} diff --git a/themes/hexo/components/MenuItemDrop.js b/themes/hexo/components/MenuItemDrop.js index 12fa81d0..c4193acb 100644 --- a/themes/hexo/components/MenuItemDrop.js +++ b/themes/hexo/components/MenuItemDrop.js @@ -31,7 +31,7 @@ export const MenuItemDrop = ({ link }) => { {link.subMenus.map(sLink => { return
    • - {sLink.title} + {link?.icon &&   }{sLink.title}
    • })} diff --git a/themes/matery/components/MenuItemDrop.js b/themes/matery/components/MenuItemDrop.js index bff61738..9a324f5d 100644 --- a/themes/matery/components/MenuItemDrop.js +++ b/themes/matery/components/MenuItemDrop.js @@ -31,7 +31,7 @@ export const MenuItemDrop = ({ link }) => { {link.subMenus.map(sLink => { return
    • - {sLink.title} + {link?.icon &&   }{sLink.title}
    • })} diff --git a/themes/medium/components/MenuItemDrop.js b/themes/medium/components/MenuItemDrop.js index e72ecbaf..454ff22d 100644 --- a/themes/medium/components/MenuItemDrop.js +++ b/themes/medium/components/MenuItemDrop.js @@ -38,7 +38,7 @@ export const MenuItemDrop = ({ link }) => { {link.subMenus.map(sLink => { return
    • - {sLink.title} + {link?.icon &&   }{sLink.title}
    • })} diff --git a/themes/nobelium/components/MenuItemDrop.js b/themes/nobelium/components/MenuItemDrop.js index 18ce2d8c..8207a35c 100644 --- a/themes/nobelium/components/MenuItemDrop.js +++ b/themes/nobelium/components/MenuItemDrop.js @@ -10,9 +10,9 @@ export const MenuItemDrop = ({ link }) => { {!hasSubMenu &&
      - {link?.icon && } {link?.name} - {hasSubMenu && } - + {link?.icon && } {link?.name} + {hasSubMenu && } +
      } @@ -28,7 +28,7 @@ export const MenuItemDrop = ({ link }) => { {link.subMenus.map(sLink => { return
    • - {sLink.title} + {link?.icon &&   }{sLink.title}
    • })} diff --git a/themes/simple/components/MenuItemDrop.js b/themes/simple/components/MenuItemDrop.js index c6a534d3..dd6a0299 100644 --- a/themes/simple/components/MenuItemDrop.js +++ b/themes/simple/components/MenuItemDrop.js @@ -31,7 +31,7 @@ export const MenuItemDrop = ({ link }) => { {link.subMenus.map(sLink => { return
    • - {sLink.title} + {link?.icon &&   }{sLink.title}
    • })} From 8af16870f9bf1ba69e1381164aef132cfbdeb2d1 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Thu, 23 Mar 2023 23:04:43 +0800 Subject: [PATCH 23/64] =?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/MenuItemDrop.js | 2 +- themes/hexo/components/TopNav.js | 2 +- themes/matery/components/MenuItemDrop.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/themes/hexo/components/MenuItemDrop.js b/themes/hexo/components/MenuItemDrop.js index c4193acb..476baadf 100644 --- a/themes/hexo/components/MenuItemDrop.js +++ b/themes/hexo/components/MenuItemDrop.js @@ -27,7 +27,7 @@ export const MenuItemDrop = ({ link }) => { } {/* 子菜单 */} - {hasSubMenu &&
        + {hasSubMenu &&
          {link.subMenus.map(sLink => { return
        • diff --git a/themes/hexo/components/TopNav.js b/themes/hexo/components/TopNav.js index d2be3cce..1e790cdd 100644 --- a/themes/hexo/components/TopNav.js +++ b/themes/hexo/components/TopNav.js @@ -133,7 +133,7 @@ const TopNav = props => { {/* 导航栏 */} -
        -
        +
        {links.map(link => collapseRef.current?.updateCollapseHeight(param)}/>)}
        From 6a7fc8a2f2ac65078881a68705b1a08fa9018965 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Sat, 25 Mar 2023 15:19:27 +0800 Subject: [PATCH 34/64] fix sth. --- components/SideBarDrawer.js | 6 +++--- themes/fukasawa/components/Catalog.js | 6 +++--- themes/matery/components/MenuItemCollapse.js | 8 ++++---- themes/medium/components/Catalog.js | 8 ++++---- themes/simple/components/Catalog.js | 8 ++++---- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/components/SideBarDrawer.js b/components/SideBarDrawer.js index 0949cda2..0db865cb 100644 --- a/components/SideBarDrawer.js +++ b/components/SideBarDrawer.js @@ -1,5 +1,5 @@ import { useRouter } from 'next/router' -import React from 'react' +import { useEffect } from 'react' /** * 侧边栏抽屉面板,可以从侧面拉出 @@ -8,7 +8,7 @@ import React from 'react' */ const SideBarDrawer = ({ children, isOpen, onOpen, onClose, className }) => { const router = useRouter() - React.useEffect(() => { + useEffect(() => { const sideBarDrawerRouteListener = () => { switchSideDrawerVisible(false) } @@ -38,7 +38,7 @@ const SideBarDrawer = ({ children, isOpen, onOpen, onClose, className }) => { } return
      } } From a223e3888717970a90e24226a93cfc1d2e901375 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Sun, 26 Mar 2023 14:54:37 +0800 Subject: [PATCH 43/64] =?UTF-8?q?=E4=BA=8C=E7=BA=A7=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E5=BC=80=E5=85=B3=E9=BB=98=E8=AE=A4=E5=85=B3=E9=97=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- blog.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blog.config.js b/blog.config.js index d2af5472..43231e3c 100644 --- a/blog.config.js +++ b/blog.config.js @@ -10,7 +10,7 @@ const BLOG = { SINCE: 2021, // e.g if leave this empty, current year will be used. APPEARANCE: process.env.NEXT_PUBLIC_APPEARANCE || 'light', // ['light', 'dark', 'auto'], // light 日间模式 , dark夜间模式, auto根据时间和主题自动夜间模式 - CUSTOM_MENU: process.env.NEXT_PUBLIC_CUSTOM_MENU || true, // 支持Menu 类型,从3.12.0版本起,各主题将逐步支持灵活的二级菜单配置,替代了原来的Page类型,此配置是试验功能、默认关闭。 + CUSTOM_MENU: process.env.NEXT_PUBLIC_CUSTOM_MENU || false, // 支持Menu 类型,从3.12.0版本起,各主题将逐步支持灵活的二级菜单配置,替代了原来的Page类型,此配置是试验功能、默认关闭。 AUTHOR: process.env.NEXT_PUBLIC_AUTHOR || 'NotionNext', // 您的昵称 例如 tangly1024 BIO: process.env.NEXT_PUBLIC_BIO || '一个普通的干饭人🍚', // 作者简介 From a7c1e0f9b5ea6a978fc58383a8cfedecbcd6d35c Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Sun, 26 Mar 2023 15:56:09 +0800 Subject: [PATCH 44/64] simple menu --- themes/simple/components/MenuItemCollapse.js | 6 +++--- themes/simple/components/MenuItemDrop.js | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/themes/simple/components/MenuItemCollapse.js b/themes/simple/components/MenuItemCollapse.js index 6abe88d8..0643d3d4 100644 --- a/themes/simple/components/MenuItemCollapse.js +++ b/themes/simple/components/MenuItemCollapse.js @@ -31,12 +31,12 @@ export const MenuItemCollapse = (props) => { {!hasSubMenu && - {link?.name} + {link?.icon && }{link?.name} } {hasSubMenu &&
      - {link?.name} + {link?.icon && }{link?.name}
      }
    @@ -46,7 +46,7 @@ export const MenuItemCollapse = (props) => { {link.subMenus.map(sLink => { return
    - {sLink.title} + {sLink?.icon && }{sLink.title}
    })} diff --git a/themes/simple/components/MenuItemDrop.js b/themes/simple/components/MenuItemDrop.js index 355d357a..8be2d7e7 100644 --- a/themes/simple/components/MenuItemDrop.js +++ b/themes/simple/components/MenuItemDrop.js @@ -15,13 +15,13 @@ export const MenuItemDrop = ({ link }) => { - {link?.name} - {hasSubMenu && } + <>{link?.icon && }{link?.name} + {hasSubMenu && } } {hasSubMenu && <>
    - {link?.name} + {link?.icon && } {link?.name}
    } @@ -31,7 +31,7 @@ export const MenuItemDrop = ({ link }) => { {link.subMenus.map(sLink => { return
  • - {link?.icon &&   }{sLink.title} + {link?.icon &&   }{sLink.title}
  • })} From de1dc185ea1710e074eb01ad7348bb51f9b7c31f Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Sun, 26 Mar 2023 15:56:34 +0800 Subject: [PATCH 45/64] simple-menu --- themes/simple/components/MenuItemDrop.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/simple/components/MenuItemDrop.js b/themes/simple/components/MenuItemDrop.js index 8be2d7e7..3367828d 100644 --- a/themes/simple/components/MenuItemDrop.js +++ b/themes/simple/components/MenuItemDrop.js @@ -31,7 +31,7 @@ export const MenuItemDrop = ({ link }) => { {link.subMenus.map(sLink => { return
  • - {link?.icon &&   }{sLink.title} + {sLink?.icon &&   }{sLink.title}
  • })} From c6d652c5f6bc6d2b115f97ad3e5492541fa12366 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Sun, 26 Mar 2023 16:23:06 +0800 Subject: [PATCH 46/64] simple-theme article-around --- themes/medium/components/ArticleAround.js | 2 +- themes/simple/LayoutSlug.js | 4 ++- themes/simple/components/ArticleAround.js | 32 +++++++++++++++++++++++ 3 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 themes/simple/components/ArticleAround.js diff --git a/themes/medium/components/ArticleAround.js b/themes/medium/components/ArticleAround.js index 45477653..95b6f83f 100644 --- a/themes/medium/components/ArticleAround.js +++ b/themes/medium/components/ArticleAround.js @@ -28,5 +28,5 @@ export default function ArticleAround ({ prev, next }) { - ); + ) } diff --git a/themes/simple/LayoutSlug.js b/themes/simple/LayoutSlug.js index 6b46a1a2..6cf7c82b 100644 --- a/themes/simple/LayoutSlug.js +++ b/themes/simple/LayoutSlug.js @@ -3,9 +3,10 @@ import { ArticleLock } from './components/ArticleLock' import NotionPage from '@/components/NotionPage' import { ArticleInfo } from './components/ArticleInfo' import Comment from '@/components/Comment' +import ArticleAround from './components/ArticleAround' export const LayoutSlug = props => { - const { post, lock, validPassword } = props + const { post, lock, validPassword, prev, next } = props if (!post) { return @@ -21,6 +22,7 @@ export const LayoutSlug = props => { {post && <> + {post.type === 'Post' && } }
    } diff --git a/themes/simple/components/ArticleAround.js b/themes/simple/components/ArticleAround.js new file mode 100644 index 00000000..b4cee232 --- /dev/null +++ b/themes/simple/components/ArticleAround.js @@ -0,0 +1,32 @@ +import Link from 'next/link' + +/** + * 上一篇,下一篇文章 + * @param {prev,next} param0 + * @returns + */ +export default function ArticleAround({ prev, next }) { + if (!prev || !next) { + return <> + } + return ( +
    + {prev && + + {prev.title} + + } + {next && + {next.title} + + + } +
    + ) +} From a09ce9f63037d318e0c6a1d893044de745983097 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Sun, 26 Mar 2023 16:27:15 +0800 Subject: [PATCH 47/64] 3.13.2 --- .env.local | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.local b/.env.local index 85b2df54..58cdf5d1 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.13.1 \ No newline at end of file +NEXT_PUBLIC_VERSION=3.13.2 \ No newline at end of file From 6322a4002acf0d82b790495bc9a14810b9e61f6f Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Sun, 26 Mar 2023 22:39:53 +0800 Subject: [PATCH 48/64] =?UTF-8?q?switch-theme=E6=A0=B7=E5=BC=8F=E8=B0=83?= =?UTF-8?q?=E6=95=B4,hexo\matery=E8=83=8C=E6=99=AF=E5=9B=BE=E5=B1=85?= =?UTF-8?q?=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/ThemeSwitch.js | 2 +- themes/hexo/components/Header.js | 2 +- themes/matery/components/BlogPostListPage.js | 2 +- themes/matery/components/BlogPostListScroll.js | 2 +- themes/matery/components/Header.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/components/ThemeSwitch.js b/components/ThemeSwitch.js index 5d2deff4..6265e035 100644 --- a/components/ThemeSwitch.js +++ b/components/ThemeSwitch.js @@ -16,7 +16,7 @@ export function ThemeSwitch() { return (<>
    -
    +
    {/*
    {theme}
    */}