diff --git a/lib/lang/en-US.js b/lib/lang/en-US.js index 928e7295..5e02c979 100644 --- a/lib/lang/en-US.js +++ b/lib/lang/en-US.js @@ -24,6 +24,7 @@ export default { AUTHOR: 'Author', URL: 'URL', POSTS: 'Posts', + ARTICLE: 'Article', VISITORS: 'Visitors', VIEWS: 'Views', COPYRIGHT_NOTICE: 'All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!', diff --git a/lib/lang/zh-CN.js b/lib/lang/zh-CN.js index 02e07cf0..915c1a9a 100644 --- a/lib/lang/zh-CN.js +++ b/lib/lang/zh-CN.js @@ -26,6 +26,7 @@ export default { URL: '链接', ANALYTICS: '统计', POSTS: '篇文章', + ARTICLE: '文章', VISITORS: '位访客', VIEWS: '次查看', COPYRIGHT_NOTICE: '本文采用 CC BY-NC-SA 4.0 许可协议,转载请注明出处。', diff --git a/themes/Hexo/components/InfoCard.js b/themes/Hexo/components/InfoCard.js new file mode 100644 index 00000000..28302d0d --- /dev/null +++ b/themes/Hexo/components/InfoCard.js @@ -0,0 +1,28 @@ +import BLOG from '@/blog.config' +import Image from 'next/image' +import { Router } from 'next/router' +import Card from './Card' +import SocialButton from './SocialButton' +import MenuButtonGroup from './MenuButtonGroup' +export function InfoCard (props) { + return +
{ + Router.push('/') + }} + > + {BLOG.AUTHOR} +
+
{BLOG.TITLE}
+ + +
+} diff --git a/themes/Hexo/components/MenuButtonGroup.js b/themes/Hexo/components/MenuButtonGroup.js index cf7af3cd..e0e6946c 100644 --- a/themes/Hexo/components/MenuButtonGroup.js +++ b/themes/Hexo/components/MenuButtonGroup.js @@ -1,37 +1,30 @@ import React from 'react' import Link from 'next/link' -import { useRouter } from 'next/router' import { useGlobal } from '@/lib/global' import CONFIG_HEXO from '../config_hexo' const MenuButtonGroup = (props) => { - const { postCount, customNav } = props + const { postCount, categories, tags } = props const { locale } = useGlobal() - const router = useRouter() - const archiveSlot =
{postCount}
+ const archiveSlot =
{postCount}
+ const categorySlot =
{categories?.length}
+ const tagSlot =
{tags?.length}
- let links = [ - { icon: 'fas fa-home', name: locale.NAV.INDEX, to: '/' || '/', show: true }, - { icon: 'fas fa-th', name: locale.COMMON.CATEGORY, to: '/category', show: CONFIG_HEXO.MENU_CATEGORY }, - { icon: 'fas fa-tag', name: locale.COMMON.TAGS, to: '/tag', show: CONFIG_HEXO.MENU_TAG }, - { icon: 'fas fa-archive', name: locale.NAV.ARCHIVE, to: '/archive', slot: archiveSlot, show: CONFIG_HEXO.MENU_ARCHIVE }, - { icon: 'fas fa-user', name: locale.NAV.ABOUT, to: '/about', show: CONFIG_HEXO.MENU_ABOUT } + const links = [ + { name: locale.COMMON.ARTICLE, to: '/archive', slot: archiveSlot, show: CONFIG_HEXO.MENU_ARCHIVE }, + { name: locale.COMMON.CATEGORY, to: '/category', slot: categorySlot, show: CONFIG_HEXO.MENU_CATEGORY }, + { name: locale.COMMON.TAGS, to: '/tag', slot: tagSlot, show: CONFIG_HEXO.MENU_TAG } ] - if (customNav) { - links = links.concat(customNav) - } - return