diff --git a/themes/Medium/LayoutBase.js b/themes/Medium/LayoutBase.js index b0519c52..f3e3b69d 100644 --- a/themes/Medium/LayoutBase.js +++ b/themes/Medium/LayoutBase.js @@ -29,8 +29,8 @@ const LayoutBase = props => {
{/* 移动端顶部菜单 */} - -
+ +
{slotTop} {children}
diff --git a/themes/Medium/LayoutCategory.js b/themes/Medium/LayoutCategory.js index 34d76d23..67d5de25 100644 --- a/themes/Medium/LayoutCategory.js +++ b/themes/Medium/LayoutCategory.js @@ -1,11 +1,9 @@ import LayoutBase from './LayoutBase' import BlogPostListScroll from './components/BlogPostListScroll' -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' -import { faTh } from '@fortawesome/free-solid-svg-icons' export const LayoutCategory = (props) => { const { category } = props - const slotTop =
分类:
{category}
+ const slotTop =
分类:
{category}
return diff --git a/themes/Medium/LayoutSlug.js b/themes/Medium/LayoutSlug.js index 8c5a441d..85ddff62 100644 --- a/themes/Medium/LayoutSlug.js +++ b/themes/Medium/LayoutSlug.js @@ -23,8 +23,6 @@ import mediumZoom from 'medium-zoom' import React, { useEffect, useRef } from 'react' import ArticleAround from './components/ArticleAround' import Catalog from './components/Catalog' -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' -import { faEye } from '@fortawesome/free-solid-svg-icons' import CategoryItem from './components/CategoryItem' import TagItemMini from './components/TagItemMini' import CONFIG_MEDIUM from './config_medium' @@ -104,7 +102,7 @@ export const LayoutSlug = props => {
{date}
- +  
@@ -139,7 +137,7 @@ export const LayoutSlug = props => {
- { CONFIG_MEDIUM.POST_DETAIL_CATEGORY && } + { CONFIG_MEDIUM.POST_DETAIL_CATEGORY && post.category && }
{ CONFIG_MEDIUM.POST_DETAIL_TAG && post?.tagItems?.map(tag => )}
diff --git a/themes/Medium/LayoutTag.js b/themes/Medium/LayoutTag.js index 042daf1c..0e6bd79b 100644 --- a/themes/Medium/LayoutTag.js +++ b/themes/Medium/LayoutTag.js @@ -1,11 +1,9 @@ import LayoutBase from './LayoutBase' import BlogPostListScroll from './components/BlogPostListScroll' -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' -import { faTag } from '@fortawesome/free-solid-svg-icons' export const LayoutTag = (props) => { const { tag } = props - const slotTop =
标签:
{tag}
+ const slotTop =
标签:
{tag}
return diff --git a/themes/Medium/components/ArticleAround.js b/themes/Medium/components/ArticleAround.js index 577198cc..6d613d41 100644 --- a/themes/Medium/components/ArticleAround.js +++ b/themes/Medium/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/Medium/components/BlogPostCard.js b/themes/Medium/components/BlogPostCard.js index f2c93a7c..c71b1345 100644 --- a/themes/Medium/components/BlogPostCard.js +++ b/themes/Medium/components/BlogPostCard.js @@ -1,7 +1,5 @@ import BLOG from '@/blog.config' import { useGlobal } from '@/lib/global' -import { faAngleRight } from '@fortawesome/free-solid-svg-icons' -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import Link from 'next/link' import React from 'react' import { Code, Collection, Equation, NotionRenderer } from 'react-notion-x' @@ -17,7 +15,7 @@ const BlogPostCard = ({ post, showSummary }) => {
- + {post.title} @@ -52,7 +50,7 @@ const BlogPostCard = ({ post, showSummary }) => { {locale.COMMON.ARTICLE_DETAIL} - +
diff --git a/themes/Medium/components/BottomMenuBar.js b/themes/Medium/components/BottomMenuBar.js index f81af654..e56b2601 100644 --- a/themes/Medium/components/BottomMenuBar.js +++ b/themes/Medium/components/BottomMenuBar.js @@ -1,5 +1,3 @@ -import { faHome, faSearch } from '@fortawesome/free-solid-svg-icons' -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import Link from 'next/link' import React from 'react' import JumpToTopButton from '@/themes/Medium/components/JumpToTopButton' @@ -10,12 +8,12 @@ export default function BottomMenuBar ({ className }) {
- +
- +
diff --git a/themes/Medium/components/CategoryGroup.js b/themes/Medium/components/CategoryGroup.js index 276577c1..cf6a7d38 100644 --- a/themes/Medium/components/CategoryGroup.js +++ b/themes/Medium/components/CategoryGroup.js @@ -1,5 +1,3 @@ -import { faTh } from '@fortawesome/free-solid-svg-icons' -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import React from 'react' import CategoryItem from './CategoryItem' @@ -8,7 +6,7 @@ const CategoryGroup = ({ currentCategory, categories }) => { return <> } return
-
分类
+
分类
{Object.keys(categories).map(category => { const selected = currentCategory === category diff --git a/themes/Medium/components/CategoryItem.js b/themes/Medium/components/CategoryItem.js index 5af5cee7..86aef898 100644 --- a/themes/Medium/components/CategoryItem.js +++ b/themes/Medium/components/CategoryItem.js @@ -1,15 +1,12 @@ import Link from 'next/link' -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' -import { faFolderOpen, faFolder } from '@fortawesome/free-solid-svg-icons' export default function CategoryItem ({ selected, category, categoryCount }) { return -
{category} {categoryCount && (categoryCount)} +
{category} {categoryCount && (categoryCount)}
diff --git a/themes/Medium/components/Footer.js b/themes/Medium/components/Footer.js index 57ad7797..7531acca 100644 --- a/themes/Medium/components/Footer.js +++ b/themes/Medium/components/Footer.js @@ -1,5 +1,3 @@ -import { faCopyright, faEye, faShieldAlt, faUsers, faHeart } from '@fortawesome/free-solid-svg-icons' -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import React from 'react' import BLOG from '@/blog.config' @@ -11,16 +9,16 @@ const Footer = ({ title }) => { diff --git a/themes/Medium/components/JumpToTopButton.js b/themes/Medium/components/JumpToTopButton.js index 6eab4596..d714f0d5 100644 --- a/themes/Medium/components/JumpToTopButton.js +++ b/themes/Medium/components/JumpToTopButton.js @@ -1,6 +1,4 @@ import { useGlobal } from '@/lib/global' -import { faArrowUp } from '@fortawesome/free-solid-svg-icons' -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import React from 'react' import CONFIG_MEDIUM from '../config_medium' @@ -19,7 +17,7 @@ const JumpToTopButton = ({ showPercent = false, percent, className }) => { const { locale } = useGlobal() return (
window.scrollTo({ top: 0, behavior: 'smooth' })} >
- +
{showPercent && (
{percent}%
)}
) diff --git a/themes/Medium/components/LeftMenuBar.js b/themes/Medium/components/LeftMenuBar.js index 680855c2..553361b2 100644 --- a/themes/Medium/components/LeftMenuBar.js +++ b/themes/Medium/components/LeftMenuBar.js @@ -1,6 +1,4 @@ import Link from 'next/link' -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' -import { faHome } from '@fortawesome/free-solid-svg-icons' import React from 'react' export default function LeftMenuBar () { @@ -8,7 +6,7 @@ export default function LeftMenuBar () {
- +
diff --git a/themes/Medium/components/PaginationSimple.js b/themes/Medium/components/PaginationSimple.js index 8006421d..5f4698ac 100644 --- a/themes/Medium/components/PaginationSimple.js +++ b/themes/Medium/components/PaginationSimple.js @@ -23,7 +23,7 @@ const PaginationSimple = ({ page, totalPage }) => { } } passHref > @@ -31,7 +31,7 @@ const PaginationSimple = ({ page, totalPage }) => { diff --git a/themes/Medium/components/SearchInput.js b/themes/Medium/components/SearchInput.js index 53dc6637..bd704624 100644 --- a/themes/Medium/components/SearchInput.js +++ b/themes/Medium/components/SearchInput.js @@ -1,7 +1,5 @@ import { useRouter } from 'next/router' import { useImperativeHandle, useRef, useState } from 'react' -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' -import { faSearch, faSpinner, faTimes } from '@fortawesome/free-solid-svg-icons' const SearchInput = ({ currentTag, currentSearch, cRef, className }) => { const [searchKey, setSearchKey] = useState(currentSearch || getSearchKey() || '') @@ -55,12 +53,12 @@ const SearchInput = ({ currentTag, currentSearch, cRef, className }) => {
{ handleSearch(searchKey) }}> - +
{(searchKey && searchKey.length &&
- +
)}
diff --git a/themes/Medium/components/SocialButton.js b/themes/Medium/components/SocialButton.js index 54b31158..d30a4434 100644 --- a/themes/Medium/components/SocialButton.js +++ b/themes/Medium/components/SocialButton.js @@ -1,7 +1,4 @@ import BLOG from '@/blog.config' -import { faGithub, faTelegram, faTwitter, faWeibo } from '@fortawesome/free-brands-svg-icons' -import { faEnvelope, faRss } from '@fortawesome/free-solid-svg-icons' -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import React from 'react' /** @@ -12,22 +9,22 @@ import React from 'react' const SocialButton = () => { return
{BLOG.CONTACT_GITHUB && - + } {BLOG.CONTACT_TWITTER && - + } {BLOG.CONTACT_TELEGRAM && - + } {BLOG.CONTACT_WEIBO && - + } {BLOG.CONTACT_EMAIL && - + } - +
} diff --git a/themes/Medium/components/TagGroups.js b/themes/Medium/components/TagGroups.js index 17da94b4..dd2a2643 100644 --- a/themes/Medium/components/TagGroups.js +++ b/themes/Medium/components/TagGroups.js @@ -1,5 +1,3 @@ -import { faTag } from '@fortawesome/free-solid-svg-icons' -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import TagItemMini from './TagItemMini' /** @@ -13,7 +11,7 @@ const TagGroups = ({ tags, currentTag }) => { if (!tags) return <> return (
-
标签
+
标签
{ tags.map(tag => { diff --git a/themes/Medium/components/TagItemMini.js b/themes/Medium/components/TagItemMini.js index fb7e3013..e406fd11 100644 --- a/themes/Medium/components/TagItemMini.js +++ b/themes/Medium/components/TagItemMini.js @@ -1,5 +1,3 @@ -import { faTag } from '@fortawesome/free-solid-svg-icons' -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import Link from 'next/link' const TagItemMini = ({ tag, selected = false }) => { @@ -9,7 +7,7 @@ const TagItemMini = ({ tag, selected = false }) => { ${selected ? 'text-white dark:text-gray-300 bg-black dark:bg-black dark:hover:bg-gray-900' : `text-gray-600 hover:shadow-xl dark:border-gray-400 notion-${tag.color}_background dark:bg-gray-800`}` }> -
{selected && } {tag.name + (tag.count ? `(${tag.count})` : '')}
+
{selected && } {tag.name + (tag.count ? `(${tag.count})` : '')}
} diff --git a/themes/Medium/components/TopNavBar.js b/themes/Medium/components/TopNavBar.js index b08dc88b..205d2be3 100644 --- a/themes/Medium/components/TopNavBar.js +++ b/themes/Medium/components/TopNavBar.js @@ -1,9 +1,40 @@ import LogoBar from '@/themes/Medium/components/LogoBar' +import Link from 'next/link' +import { useRouter } from 'next/router' + +/** + * 顶部导航栏 + 菜单 + * @param {} param0 + * @returns + */ +export default function TopNavBar (props) { + const { className, customNav } = props + const router = useRouter() -export default function TopNavBar ({ className }) { return
-
+
+ + {/* 顶部菜单 */} +
+ {customNav && customNav.map(link => { + if (link.show) { + const selected = (router.pathname === link.to) || (router.asPath === link.to) + return + +
+ +
{link.name}
+
+ {link.slot} +
+ + } else { + return null + } + })} +
} diff --git a/themes/index.js b/themes/index.js index 13b192e4..d17405e5 100644 --- a/themes/index.js +++ b/themes/index.js @@ -4,6 +4,6 @@ // export * from './Empty' // 空主题 // export * from './NEXT' -export * from './Fukasawa' +// export * from './Fukasawa' // export * from './Hexo' -// export * from './Medium' +export * from './Medium'