From 52a3bc7d0a6853c16f610d7b7e87da68948affbe Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Sun, 27 Feb 2022 21:57:03 +0800 Subject: [PATCH] =?UTF-8?q?Fukasawa:=20Fontawesome=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/Fukasawa/LayoutBase.js | 8 ++------ themes/Fukasawa/LayoutCategoryIndex.js | 6 ++---- themes/Fukasawa/LayoutTagIndex.js | 4 +--- themes/Fukasawa/components/ArticleAround.js | 6 ++---- themes/Fukasawa/components/ArticleDetail.js | 6 ++---- themes/Fukasawa/components/AsideLeft.js | 5 +++-- themes/Fukasawa/components/GroupCategory.js | 4 +--- themes/Fukasawa/components/GroupMenu.js | 20 ++++++++++++-------- themes/Fukasawa/components/SearchInput.js | 6 ++---- themes/Fukasawa/components/SiteInfo.js | 8 +++----- themes/Fukasawa/components/TagItem.js | 4 +--- themes/Fukasawa/components/TagItemMini.js | 4 +--- themes/Fukasawa/components/TopNav.js | 12 ++++-------- themes/index.js | 4 ++-- 14 files changed, 38 insertions(+), 59 deletions(-) diff --git a/themes/Fukasawa/LayoutBase.js b/themes/Fukasawa/LayoutBase.js index 1d3f3a57..39603acb 100644 --- a/themes/Fukasawa/LayoutBase.js +++ b/themes/Fukasawa/LayoutBase.js @@ -20,17 +20,13 @@ const LayoutBase = (props) => { const { children, headerSlot, - tags, - meta, - currentCategory, - currentTag, - categories + meta } = props return (<>
- +
{headerSlot}
diff --git a/themes/Fukasawa/LayoutCategoryIndex.js b/themes/Fukasawa/LayoutCategoryIndex.js index 0def1581..0941d901 100644 --- a/themes/Fukasawa/LayoutCategoryIndex.js +++ b/themes/Fukasawa/LayoutCategoryIndex.js @@ -1,7 +1,5 @@ import BLOG from '@/blog.config' import { useGlobal } from '@/lib/global' -import { faFolder, faTh } from '@fortawesome/free-solid-svg-icons' -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import Link from 'next/link' import LayoutBase from './LayoutBase' @@ -16,14 +14,14 @@ export const LayoutCategoryIndex = (props) => { return
- {locale.COMMON.CATEGORY}: + {locale.COMMON.CATEGORY}:
{Object.keys(categories).map(category => { return
- {category}({categories[category]}) + {category}({categories[category]})
})} diff --git a/themes/Fukasawa/LayoutTagIndex.js b/themes/Fukasawa/LayoutTagIndex.js index 1d93708d..0642dbd9 100644 --- a/themes/Fukasawa/LayoutTagIndex.js +++ b/themes/Fukasawa/LayoutTagIndex.js @@ -1,7 +1,5 @@ import BLOG from '@/blog.config' import { useGlobal } from '@/lib/global' -import { faTag } from '@fortawesome/free-solid-svg-icons' -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import TagItem from './components/TagItem' import LayoutBase from './LayoutBase' @@ -16,7 +14,7 @@ export const LayoutTagIndex = (props) => { return
-
{locale.COMMON.TAGS}:
+
{locale.COMMON.TAGS}:
{ tags.map(tag => { return
diff --git a/themes/Fukasawa/components/ArticleAround.js b/themes/Fukasawa/components/ArticleAround.js index 7f42e575..efb6c09b 100644 --- a/themes/Fukasawa/components/ArticleAround.js +++ b/themes/Fukasawa/components/ArticleAround.js @@ -1,6 +1,4 @@ import Link from 'next/link' -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' -import { faAngleDoubleLeft, faAngleDoubleRight } from '@fortawesome/free-solid-svg-icons' /** * 上一篇,下一篇文章 @@ -14,12 +12,12 @@ export default function ArticleAround ({ prev, next }) { return
- {prev.title} + {prev.title} {next.title} - +
diff --git a/themes/Fukasawa/components/ArticleDetail.js b/themes/Fukasawa/components/ArticleDetail.js index cdc46ff7..7974d413 100644 --- a/themes/Fukasawa/components/ArticleDetail.js +++ b/themes/Fukasawa/components/ArticleDetail.js @@ -1,8 +1,6 @@ import Comment from '@/components/Comment' import formatDate from '@/lib/formatDate' import { useGlobal } from '@/lib/global' -import { faEye, faFolderOpen } from '@fortawesome/free-solid-svg-icons' -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import mediumZoom from 'medium-zoom' import Link from 'next/link' import 'prismjs' @@ -64,7 +62,7 @@ export default function ArticleDetail ({ post, recommendPosts, prev, next }) {
- + {post.category} @@ -83,7 +81,7 @@ export default function ArticleDetail ({ post, recommendPosts, prev, next }) { )}
- +   | diff --git a/themes/Fukasawa/components/AsideLeft.js b/themes/Fukasawa/components/AsideLeft.js index 79aaed1c..2f668d43 100644 --- a/themes/Fukasawa/components/AsideLeft.js +++ b/themes/Fukasawa/components/AsideLeft.js @@ -6,14 +6,15 @@ import GroupTag from './GroupTag' import SearchInput from './SearchInput' import SiteInfo from './SiteInfo' -function AsideLeft ({ tags, currentTag, categories, currentCategory }) { +function AsideLeft (props) { + const { tags, currentTag, categories, currentCategory } = props return

- +
diff --git a/themes/Fukasawa/components/GroupCategory.js b/themes/Fukasawa/components/GroupCategory.js index 8e17fd5e..3dd437d8 100644 --- a/themes/Fukasawa/components/GroupCategory.js +++ b/themes/Fukasawa/components/GroupCategory.js @@ -1,5 +1,3 @@ -import { faFolder, faFolderOpen } from '@fortawesome/free-solid-svg-icons' -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import Link from 'next/link' import React from 'react' @@ -17,7 +15,7 @@ function GroupCategory ({ currentCategory, categories }) { ? 'hover:text-white dark:hover:text-white bg-gray-600 text-white ' : 'dark:text-gray-400 text-gray-500 hover:text-white hover:bg-gray-500 dark:hover:text-white') + ' text-sm w-full items-center duration-300 px-2 cursor-pointer py-1 font-light'}> - {category}({categories[category]}) + {category}({categories[category]}) })} diff --git a/themes/Fukasawa/components/GroupMenu.js b/themes/Fukasawa/components/GroupMenu.js index 4b97583d..79fccdef 100644 --- a/themes/Fukasawa/components/GroupMenu.js +++ b/themes/Fukasawa/components/GroupMenu.js @@ -4,22 +4,26 @@ import { useRouter } from 'next/router' import { useGlobal } from '@/lib/global' import CONFIG_FUKA from '../config_fuka' -function GroupMenu () { +function GroupMenu ({ customNav }) { const { locale } = useGlobal() const router = useRouter() - const links = [ - { id: 0, name: locale.NAV.INDEX, to: '/' || '/', show: true }, - { id: 1, name: locale.COMMON.CATEGORY, to: '/category', show: CONFIG_FUKA.MENU_CATEGORY }, - { id: 2, name: locale.COMMON.TAGS, to: '/tag', show: CONFIG_FUKA.MENU_TAG }, - { id: 3, name: locale.NAV.ARCHIVE, to: '/archive', show: CONFIG_FUKA.MENU_ARCHIVE }, - { id: 4, name: locale.NAV.ABOUT, to: '/about', show: CONFIG_FUKA.MENU_ABOUT } + let links = [ + { name: locale.NAV.INDEX, to: '/' || '/', show: true }, + { name: locale.COMMON.CATEGORY, to: '/category', show: CONFIG_FUKA.MENU_CATEGORY }, + { name: locale.COMMON.TAGS, to: '/tag', show: CONFIG_FUKA.MENU_TAG }, + { name: locale.NAV.ARCHIVE, to: '/archive', show: CONFIG_FUKA.MENU_ARCHIVE } ] + + if (customNav) { + links = links.concat(customNav) + } + return