From c1fa5fa3c5faa8950703a6e8023320fc181ac373 Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Wed, 5 Jul 2023 16:06:23 +0800 Subject: [PATCH] theme-fukasawa --- components/ShareBar.js | 18 +- pages/search/index.js | 5 + themes/fukasawa/components/AsideLeft.js | 4 +- themes/fukasawa/components/MenuItemDrop.js | 4 +- themes/fukasawa/config_fuka.js | 4 +- themes/fukasawa/index.js | 82 ++++-- themes/nobelium/Layout404.js | 9 - themes/nobelium/LayoutArchive.js | 47 --- themes/nobelium/LayoutBase.js | 52 ---- themes/nobelium/LayoutCategory.js | 12 - themes/nobelium/LayoutCategoryIndex.js | 29 -- themes/nobelium/LayoutIndex.js | 17 -- themes/nobelium/LayoutPage.js | 12 - themes/nobelium/LayoutSearch.js | 58 ---- themes/nobelium/LayoutSlug.js | 35 --- themes/nobelium/LayoutTag.js | 59 ---- themes/nobelium/LayoutTagIndex.js | 31 -- themes/nobelium/components/ArticleInfo.js | 6 +- themes/nobelium/components/BlogArchiveItem.js | 41 +++ themes/nobelium/components/BlogListBar.js | 39 +++ themes/nobelium/components/SearchNavBar.js | 17 ++ themes/nobelium/index.js | 271 ++++++++++++++++- themes/simple/Layout404.js | 9 - themes/simple/LayoutArchive.js | 47 --- themes/simple/LayoutBase.js | 73 ----- themes/simple/LayoutCategory.js | 12 - themes/simple/LayoutCategoryIndex.js | 28 -- themes/simple/LayoutIndex.js | 15 - themes/simple/LayoutPage.js | 12 - themes/simple/LayoutSearch.js | 52 ---- themes/simple/LayoutSlug.js | 40 --- themes/simple/LayoutTag.js | 12 - themes/simple/LayoutTagIndex.js | 31 -- themes/simple/components/BlogArchiveItem.js | 41 +++ themes/simple/components/SearchInput.js | 86 ++++++ themes/simple/index.js | 273 +++++++++++++++++- 36 files changed, 820 insertions(+), 763 deletions(-) delete mode 100644 themes/nobelium/Layout404.js delete mode 100644 themes/nobelium/LayoutArchive.js delete mode 100644 themes/nobelium/LayoutBase.js delete mode 100644 themes/nobelium/LayoutCategory.js delete mode 100644 themes/nobelium/LayoutCategoryIndex.js delete mode 100644 themes/nobelium/LayoutIndex.js delete mode 100644 themes/nobelium/LayoutPage.js delete mode 100644 themes/nobelium/LayoutSearch.js delete mode 100644 themes/nobelium/LayoutSlug.js delete mode 100644 themes/nobelium/LayoutTag.js delete mode 100644 themes/nobelium/LayoutTagIndex.js create mode 100644 themes/nobelium/components/BlogArchiveItem.js create mode 100644 themes/nobelium/components/BlogListBar.js create mode 100644 themes/nobelium/components/SearchNavBar.js delete mode 100644 themes/simple/Layout404.js delete mode 100644 themes/simple/LayoutArchive.js delete mode 100644 themes/simple/LayoutBase.js delete mode 100644 themes/simple/LayoutCategory.js delete mode 100644 themes/simple/LayoutCategoryIndex.js delete mode 100644 themes/simple/LayoutIndex.js delete mode 100644 themes/simple/LayoutPage.js delete mode 100644 themes/simple/LayoutSearch.js delete mode 100644 themes/simple/LayoutSlug.js delete mode 100644 themes/simple/LayoutTag.js delete mode 100644 themes/simple/LayoutTagIndex.js create mode 100644 themes/simple/components/BlogArchiveItem.js create mode 100644 themes/simple/components/SearchInput.js diff --git a/components/ShareBar.js b/components/ShareBar.js index b55c4dc9..caf03666 100644 --- a/components/ShareBar.js +++ b/components/ShareBar.js @@ -14,15 +14,15 @@ const ShareBar = ({ post }) => { return
- +
} diff --git a/pages/search/index.js b/pages/search/index.js index 9fe02dbb..eb545434 100644 --- a/pages/search/index.js +++ b/pages/search/index.js @@ -4,6 +4,11 @@ import { useRouter } from 'next/router' import BLOG from '@/blog.config' import { getLayoutByTheme } from '@/themes/theme' +/** + * 搜索路由 + * @param {*} props + * @returns + */ const Search = props => { const { posts, siteInfo } = props const { locale } = useGlobal() diff --git a/themes/fukasawa/components/AsideLeft.js b/themes/fukasawa/components/AsideLeft.js index e839d0a7..6d263e7c 100644 --- a/themes/fukasawa/components/AsideLeft.js +++ b/themes/fukasawa/components/AsideLeft.js @@ -9,12 +9,12 @@ import Announcement from './Announcement' import { useRouter } from 'next/router' import DarkModeButton from '@/components/DarkModeButton' import SocialButton from './SocialButton' -import { useState } from 'react' +import { useFukasawaGlobal } from '..' function AsideLeft(props) { const { tagOptions, currentTag, categoryOptions, currentCategory, post, slot, siteInfo, notice } = props const router = useRouter() - const [open, setOpen] = useState(true) + const { open, setOpen } = useFukasawaGlobal() // 折叠侧边栏 const toggleOpen = () => { setOpen(!open) diff --git a/themes/fukasawa/components/MenuItemDrop.js b/themes/fukasawa/components/MenuItemDrop.js index 8c768478..efcc19a2 100644 --- a/themes/fukasawa/components/MenuItemDrop.js +++ b/themes/fukasawa/components/MenuItemDrop.js @@ -23,8 +23,8 @@ export const MenuItemDrop = ({ link }) => { {/* 子菜单 */} {hasSubMenu &&