diff --git a/lib/config.js b/lib/config.js index ee56f91d..9d2ddf39 100644 --- a/lib/config.js +++ b/lib/config.js @@ -31,7 +31,6 @@ export const siteConfig = (key, defaultVal = null, extendConfig = null) => { if (global) { val = global.NOTION_CONFIG?.[key] siteInfo = global.siteInfo - // console.log('当前变量', key, val) } if (!val) { @@ -56,6 +55,9 @@ export const siteConfig = (key, defaultVal = null, extendConfig = null) => { if (!val && extendConfig) { val = extendConfig[key] } + if (extendConfig) { + console.log('extendConfig', extendConfig[key]) + } // 其次 NOTION没有找到配置,则会读取blog.config.js文件 if (!val) { diff --git a/themes/commerce/components/ProductCenter.js b/themes/commerce/components/ProductCenter.js index ec82469d..ba882dbd 100644 --- a/themes/commerce/components/ProductCenter.js +++ b/themes/commerce/components/ProductCenter.js @@ -1,4 +1,5 @@ import { siteConfig } from '@/lib/config' +import CONFIG from '../config' import ProductCard from './ProductCard' import ProductCategories from './ProductCategories' @@ -9,25 +10,42 @@ import ProductCategories from './ProductCategories' */ export default function ProductCenter(props) { const { allNavPages } = props - const posts = allNavPages.slice(0, parseInt(siteConfig('COMMERCE_HOME_POSTS_COUNT', 9))) - - return