diff --git a/components/ShareBar.js b/components/ShareBar.js index 334a5f12..1acbef4e 100644 --- a/components/ShareBar.js +++ b/components/ShareBar.js @@ -1,7 +1,9 @@ import { siteConfig } from '@/lib/config' import dynamic from 'next/dynamic' -const ShareButtons = dynamic(() => import('@/components/ShareButtons'), { ssr: false }) +const ShareButtons = dynamic(() => import('@/components/ShareButtons'), { + ssr: false +}) /** * 分享栏 @@ -9,14 +11,20 @@ const ShareButtons = dynamic(() => import('@/components/ShareButtons'), { ssr: f * @returns */ const ShareBar = ({ post }) => { - if (!JSON.parse(siteConfig('POST_SHARE_BAR_ENABLE')) || !post || post?.type !== 'Post') { + if ( + !JSON.parse(siteConfig('POST_SHARE_BAR_ENABLE')) || + !post || + post?.type !== 'Post' + ) { return <> } - return
-
- -
+ return ( +
+
+ +
+ ) } export default ShareBar diff --git a/themes/magzine/components/ArchiveItem.js b/themes/magzine/components/ArchiveItem.js deleted file mode 100644 index 2dafd34c..00000000 --- a/themes/magzine/components/ArchiveItem.js +++ /dev/null @@ -1,36 +0,0 @@ -import Link from 'next/link' - -/** - * 归档分组 - * @param {*} param0 - * @returns - */ -export default function ArchiveItem({ archiveTitle, archivePosts }) { - return ( -
-
- {archiveTitle} -
- -
- ) -} diff --git a/themes/magzine/components/ArticleInfo.js b/themes/magzine/components/ArticleInfo.js index 02461b8d..5bedfbec 100644 --- a/themes/magzine/components/ArticleInfo.js +++ b/themes/magzine/components/ArticleInfo.js @@ -1,7 +1,6 @@ import LazyImage from '@/components/LazyImage' import NotionIcon from '@/components/NotionIcon' import { siteConfig } from '@/lib/config' -import Link from 'next/link' import CategoryItem from './CategoryItem' import TagItemMini from './TagItemMini' @@ -15,8 +14,8 @@ export default function ArticleInfo(props) { return ( <> -
-
+
+
{siteConfig('MAGZINE_POST_LIST_CATEGORY') && ( )} @@ -32,7 +31,7 @@ export default function ArticleInfo(props) {
{/* title */} -

+

{siteConfig('POST_TITLE_ICON') && ( )} @@ -51,40 +50,6 @@ export default function ArticleInfo(props) { />

)} - - {/* meta */} -
-
- - {' '} - - {post?.publishDay} - - | - - - {post?.lastEditedDay} - -
- - -
-
- -
- - -
- {siteConfig('AUTHOR')} -
-
- -
) } diff --git a/themes/magzine/components/BannerFullWidth.js b/themes/magzine/components/BannerFullWidth.js new file mode 100644 index 00000000..fadebaa6 --- /dev/null +++ b/themes/magzine/components/BannerFullWidth.js @@ -0,0 +1,30 @@ +import LazyImage from '@/components/LazyImage' +import { siteConfig } from '@/lib/config' +import { useGlobal } from '@/lib/global' +import BannerItem from './BannerItem' + +/** + * 全宽 + * @param {*} props + * @returns + */ +export default function BannerFullWidth() { + const { siteInfo } = useGlobal() + const banner = siteConfig('MAGZINE_HOME_BANNER_ENABLE') + if (!banner) { + return null + } + return ( +
+ + +
+ +
+
+ ) +} diff --git a/themes/magzine/components/BannerItem.js b/themes/magzine/components/BannerItem.js new file mode 100644 index 00000000..3e77271a --- /dev/null +++ b/themes/magzine/components/BannerItem.js @@ -0,0 +1,35 @@ +import { siteConfig } from '@/lib/config' +import Link from 'next/link' + +/** + * 文字广告Banner + * @param {*} props + * @returns + */ +export default function BannerItem() { + // 首屏信息栏按钮文字 + const banner = siteConfig('MAGZINE_HOME_BANNER_ENABLE') + const button = siteConfig('MAGZINE_HOME_BUTTON') + const text = siteConfig('MAGZINE_HOME_BUTTON_TEXT') + const url = siteConfig('MAGZINE_HOME_BUTTON_URL') + const title = siteConfig('MAGZINE_HOME_TITLE') + const description = siteConfig('MAGZINE_HOME_DESCRIPTION') + const tips = siteConfig('MAGZINE_HOME_TIPS') + if (!banner) { + return null + } + + return ( +
+ {/* 首屏导航按钮 */} +

{title}

+

{description}

+ {button && ( +
+ {text} +
+ )} + {tips} +
+ ) +} diff --git a/themes/magzine/components/Catalog.js b/themes/magzine/components/Catalog.js index 4ee2c282..b127d24a 100644 --- a/themes/magzine/components/Catalog.js +++ b/themes/magzine/components/Catalog.js @@ -9,7 +9,7 @@ import Progress from './Progress' * @returns {JSX.Element} * @constructor */ -const Catalog = ({ toc }) => { +const Catalog = ({ toc, className }) => { const tocIds = [] // 目录自动滚动 @@ -62,7 +62,7 @@ const Catalog = ({ toc }) => { } return ( -
+
diff --git a/themes/magzine/components/CategoryGroup.js b/themes/magzine/components/CategoryGroup.js index 3fd6b67d..063eb58c 100644 --- a/themes/magzine/components/CategoryGroup.js +++ b/themes/magzine/components/CategoryGroup.js @@ -13,11 +13,8 @@ const CategoryGroup = ({ currentCategory, categoryOptions }) => { } return (
-
- - {locale.COMMON.CATEGORY} -
-
+
{locale.COMMON.CATEGORY}
+
{categoryOptions?.map(category => { const selected = currentCategory === category.name return ( diff --git a/themes/magzine/components/CategoryItem.js b/themes/magzine/components/CategoryItem.js index 1286d35e..44fd3845 100644 --- a/themes/magzine/components/CategoryItem.js +++ b/themes/magzine/components/CategoryItem.js @@ -9,12 +9,9 @@ export default function CategoryItem({ selected, category, categoryCount }) { (selected ? ' bg-gray-600 text-white ' : 'dark:text-gray-400 text-gray-900 ') + - ' hover:underline flex text-sm items-center duration-300 cursor-pointer py-1 whitespace-nowrap' + 'text-sm hover:underline flex text-md items-center duration-300 cursor-pointer py-1 whitespace-nowrap' }>
- {/* */} {category} {categoryCount && `(${categoryCount})`}
diff --git a/themes/magzine/components/Footer.js b/themes/magzine/components/Footer.js index b3672dda..4d20657d 100644 --- a/themes/magzine/components/Footer.js +++ b/themes/magzine/components/Footer.js @@ -16,14 +16,13 @@ const Footer = ({ title }) => { parseInt(since) < currentYear ? since + '-' + currentYear : currentYear const { siteInfo } = useGlobal() const MAGZINE_FOOTER_LINKS = siteConfig('MAGZINE_FOOTER_LINKS', []) - console.log('菜单', MAGZINE_FOOTER_LINKS) return (