diff --git a/themes/commerce/components/BlogPostListPage.js b/themes/commerce/components/BlogPostListPage.js index c185265c..3f4583c3 100644 --- a/themes/commerce/components/BlogPostListPage.js +++ b/themes/commerce/components/BlogPostListPage.js @@ -20,7 +20,7 @@ const BlogPostListPage = ({ page = 1, posts = [], postCount, siteInfo }) => { return (
{/* 文章列表 */} -
+
{posts?.map(post => ( ))} diff --git a/themes/commerce/components/ProductCategories.js b/themes/commerce/components/ProductCategories.js new file mode 100644 index 00000000..54ec316e --- /dev/null +++ b/themes/commerce/components/ProductCategories.js @@ -0,0 +1,27 @@ +import { siteConfig } from '@/lib/config' +import Link from 'next/link' + +export default function ProductCategories(props) { + const { categoryOptions } = props + + return
+ {/* 分类菜单 */} +
+
{siteConfig('COMMERCE_TEXT_MENU_GROUP', 'Product Categories')}
+ +
+
+} diff --git a/themes/commerce/components/ProductCenter.js b/themes/commerce/components/ProductCenter.js index 17d10a90..ec82469d 100644 --- a/themes/commerce/components/ProductCenter.js +++ b/themes/commerce/components/ProductCenter.js @@ -1,6 +1,6 @@ import { siteConfig } from '@/lib/config' -import Link from 'next/link' import ProductCard from './ProductCard' +import ProductCategories from './ProductCategories' /** * 产品中心 @@ -8,7 +8,7 @@ import ProductCard from './ProductCard' * @returns */ export default function ProductCenter(props) { - const { categoryOptions, allNavPages } = props + const { allNavPages } = props const posts = allNavPages.slice(0, parseInt(siteConfig('COMMERCE_HOME_POSTS_COUNT', 9))) return
@@ -17,26 +17,7 @@ export default function ProductCenter(props) {
-
- {/* 分类菜单 */} -
-
{siteConfig('COMMERCE_TEXT_MENU_GROUP', 'Product Categories')}
- -
-
+
{/* 文章列表 */} diff --git a/themes/commerce/components/SlotBar.js b/themes/commerce/components/SlotBar.js index fff30e39..c7c1c802 100644 --- a/themes/commerce/components/SlotBar.js +++ b/themes/commerce/components/SlotBar.js @@ -9,15 +9,15 @@ export default function SlotBar(props) { const { tag, category } = props if (tag) { - return
+ return
-
#{tag}
+
#{tag}
} else if (category) { - return
- {category} + return
+ {category}
} return <> diff --git a/themes/commerce/index.js b/themes/commerce/index.js index cca45ee3..136b325f 100644 --- a/themes/commerce/index.js +++ b/themes/commerce/index.js @@ -30,6 +30,7 @@ import { siteConfig } from '@/lib/config' import TopNavBar from './components/TopNavBar' import ProductCenter from './components/ProductCenter' import LazyImage from '@/components/LazyImage' +import ProductCategories from './components/ProductCategories' /** * 基础布局 采用左右两侧布局,移动端使用顶部导航栏 @@ -139,9 +140,12 @@ const LayoutIndex = (props) => { * @returns */ const LayoutPostList = (props) => { - return - - {siteConfig('POST_LIST_STYLE') === 'page' ? : } + const slotRight = + return +
+ + {siteConfig('POST_LIST_STYLE') === 'page' ? : } +
} @@ -242,7 +246,7 @@ const LayoutSlug = props => {
-
+