diff --git a/themes/next/LayoutCategory.js b/themes/next/LayoutCategory.js index 063918d4..ec71cb95 100644 --- a/themes/next/LayoutCategory.js +++ b/themes/next/LayoutCategory.js @@ -6,10 +6,10 @@ import BlogPostListPage from './components/BlogPostListPage' import BLOG from '@/blog.config' export const LayoutCategory = (props) => { - const { category, categories } = props + const { category, categoryOptions } = props return - +
{BLOG.POST_LIST_STYLE !== 'page' diff --git a/themes/next/LayoutCategoryIndex.js b/themes/next/LayoutCategoryIndex.js index 9089fff8..0dd99e0f 100644 --- a/themes/next/LayoutCategoryIndex.js +++ b/themes/next/LayoutCategoryIndex.js @@ -3,7 +3,7 @@ import LayoutBase from './LayoutBase' import Link from 'next/link' export const LayoutCategoryIndex = (props) => { - const { allPosts, categories } = props + const { allPosts, categoryOptions } = props const { locale } = useGlobal() return ( @@ -12,7 +12,7 @@ export const LayoutCategoryIndex = (props) => { {locale.COMMON.CATEGORY}:
- {categories.map(category => { + {categoryOptions.map(category => { return ( { {category.name}({category.count})
- ); + ) })}
- ); + ) } diff --git a/themes/next/LayoutTag.js b/themes/next/LayoutTag.js index fdb47239..c70307e8 100644 --- a/themes/next/LayoutTag.js +++ b/themes/next/LayoutTag.js @@ -6,11 +6,11 @@ import BlogPostListPage from './components/BlogPostListPage' import BLOG from '@/blog.config' export const LayoutTag = (props) => { - const { tags, tag } = props + const { tagOptions, tag } = props return - +
{BLOG.POST_LIST_STYLE !== 'page' diff --git a/themes/next/LayoutTagIndex.js b/themes/next/LayoutTagIndex.js index 45100a9e..5278dd8f 100644 --- a/themes/next/LayoutTagIndex.js +++ b/themes/next/LayoutTagIndex.js @@ -3,13 +3,13 @@ import LayoutBase from './LayoutBase' import TagItem from './components/TagItem' export const LayoutTagIndex = (props) => { - const { tags } = props + const { tagOptions } = props const { locale } = useGlobal() return
{locale.COMMON.TAGS}:
- { tags.map(tag => { + { tagOptions.map(tag => { return
}) }
diff --git a/themes/next/components/CategoryList.js b/themes/next/components/CategoryList.js index 2d384479..ffe038ef 100644 --- a/themes/next/components/CategoryList.js +++ b/themes/next/components/CategoryList.js @@ -2,16 +2,16 @@ import Link from 'next/link' import React from 'react' import { useGlobal } from '@/lib/global' -const CategoryList = ({ currentCategory, categories }) => { - if (!categories) { +const CategoryList = ({ currentCategory, categoryOptions }) => { + const { locale } = useGlobal() + if (!categoryOptions) { return <> } - const { locale } = useGlobal() return (
  • {locale.COMMON.CATEGORY}
  • - {categories.map(category => { + {categoryOptions.map(category => { const selected = category.name === currentCategory return ( { - ); + ) })}
- ); + ) } export default CategoryList diff --git a/themes/next/components/TagList.js b/themes/next/components/TagList.js index f5b7d030..973e7b68 100644 --- a/themes/next/components/TagList.js +++ b/themes/next/components/TagList.js @@ -7,13 +7,13 @@ import TagItem from './TagItem' * @returns {JSX.Element} * @constructor */ -const TagList = ({ tags, currentTag }) => { - if (!tags) { +const TagList = ({ tagOptions, currentTag }) => { + if (!tagOptions) { return <> } return
  • 标签:
  • - {tags.map(tag => { + {tagOptions.map(tag => { const selected = tag.name === currentTag return })}