From d30731ff8af03d4d3177b1ce9b9cf4e344e01e04 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Tue, 4 Jan 2022 11:34:54 +0800 Subject: [PATCH] =?UTF-8?q?feature:=20=E5=8F=B3=E8=BE=B9=E4=BE=A7=E8=BE=B9?= =?UTF-8?q?=E6=A0=8F=E5=8F=AF=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- blog.config.js | 7 ++-- components/JumpToBottomButton.js | 2 +- components/JumpToTopButton.js | 2 +- components/SideAreaLeft.js | 4 +-- components/SideAreaRight.js | 56 ++++++++++---------------------- layouts/BaseLayout.js | 8 ++--- 6 files changed, 28 insertions(+), 51 deletions(-) diff --git a/blog.config.js b/blog.config.js index 94ffa390..09582ff9 100644 --- a/blog.config.js +++ b/blog.config.js @@ -6,7 +6,7 @@ const BLOG = { description: '分享编程技术与记录生活', keywords: ['Notion', '写作', '博客'], home: { // 首页 - showHomeBanner: true, // 首页是否显示大图及标语 [true,false] + showHomeBanner: false, // 首页是否显示大图及标语 [true,false] homeBannerStrings: ['Hi,我是一个程序员', 'Hi,我是一个打工人', 'Hi,我是一个干饭人', '欢迎来到我的博客🎉'], // 首页大图标语文字 homeBannerImage: './bg_image.jpg' // 首图 }, @@ -38,7 +38,10 @@ const BLOG = { showToc: true, showShareBar: false, showRelatePosts: false, - showCopyRight: false + showCopyRight: false, + showLatestPost: false, + showCategoryList: false, + showTagList: false }, socialLink: { // 社交链接 weibo: 'https://weibo.com/tangly1024', diff --git a/components/JumpToBottomButton.js b/components/JumpToBottomButton.js index 591f9eab..a72976a9 100644 --- a/components/JumpToBottomButton.js +++ b/components/JumpToBottomButton.js @@ -43,7 +43,7 @@ const JumpToBottomButton = ({ targetRef, showPercent = false }) => { return (
window.scrollTo({ top: targetRef.current.clientHeight, behavior: 'smooth' })} className={(show ? '' : 'hidden') + ' animate__fadeInRight duration-500 animate__animated animate__faster glassmorphism flex justify-center items-center w-8 h-8 cursor-pointer '}> -
+
{showPercent && (
{percent}
)} diff --git a/components/JumpToTopButton.js b/components/JumpToTopButton.js index 47601e7d..7512d93f 100644 --- a/components/JumpToTopButton.js +++ b/components/JumpToTopButton.js @@ -44,7 +44,7 @@ const JumpToTopButton = ({ targetRef, showPercent = false }) => { return (
window.scrollTo({ top: 0, behavior: 'smooth' })} className={(show ? '' : 'hidden') + ' animate__fadeInRight duration-500 animate__animated animate__faster flex justify-center items-center w-8 h-8 glassmorphism cursor-pointer '}> -
+
{showPercent && (
{percent}
)} diff --git a/components/SideAreaLeft.js b/components/SideAreaLeft.js index 2b1c4a81..a8f84100 100644 --- a/components/SideAreaLeft.js +++ b/components/SideAreaLeft.js @@ -24,7 +24,7 @@ const SideAreaLeft = ({ title, tags, currentTag, post, posts, categories, curren const { locale } = useGlobal() const showToc = post && post.toc && post.toc.length > 1 const postCount = posts?.length || 0 - return <> + return } export default SideAreaLeft diff --git a/components/SideAreaRight.js b/components/SideAreaRight.js index 2e365eab..408159a0 100644 --- a/components/SideAreaRight.js +++ b/components/SideAreaRight.js @@ -1,8 +1,12 @@ +import BLOG from '@/blog.config' import LatestPostsGroup from '@/components/LatestPostsGroup' import { useGlobal } from '@/lib/global' -import { faArchive } from '@fortawesome/free-solid-svg-icons' +import { faAngleDoubleRight, faAngleRight, faArchive, faTags, faThList } from '@fortawesome/free-solid-svg-icons' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' +import Link from 'next/link' import React from 'react' +import CategoryGroup from './CategoryGroup' +import TagGroups from './TagGroups' /** * 侧边平铺 @@ -28,23 +32,12 @@ const SideAreaRight = ({ targetRef }) => { const { locale } = useGlobal() - // const postCount = posts?.length || 0 - // const showToc = post && post.toc && post.toc.length > 1 + const { widget } = BLOG + if (!widget?.showCategoryList && !widget.showTagList && !widget.showLatestPost) { + return <> + } - return ( - <> - - {/*
- -
*/} - - {/* 菜单 */} - {/*
- -
- -
-
*/} + return ( ) } export default SideAreaRight diff --git a/layouts/BaseLayout.js b/layouts/BaseLayout.js index 9142215a..c8017807 100644 --- a/layouts/BaseLayout.js +++ b/layouts/BaseLayout.js @@ -54,9 +54,7 @@ const BaseLayout = ({ <>{headerSlot}
- +
{onLoading ? @@ -65,9 +63,7 @@ const BaseLayout = ({ }
- +