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
-
{siteConfig('COMMERCE_TEXT_CENTER_TITLE', 'Product Center')}
- {siteConfig('COMMERCE_TEXT_CENTER_DESCRIPTION') &&
{siteConfig('COMMERCE_TEXT_CENTER_DESCRIPTION')}
} - -
- - - -
- {/* 文章列表 */} -
- {posts?.map(post => ( - - ))} -
- -
+ const posts = allNavPages.slice( + 0, + parseInt(siteConfig('COMMERCE_HOME_POSTS_COUNT', 9)) + ) + const COMMERCE_TEXT_CENTER_TITLE = siteConfig( + 'COMMERCE_TEXT_CENTER_TITLE', + 'Product Center', + CONFIG + ) + return ( +
+
+ {COMMERCE_TEXT_CENTER_TITLE} +
+ {siteConfig('COMMERCE_TEXT_CENTER_DESCRIPTION') && ( +
+ {siteConfig('COMMERCE_TEXT_CENTER_DESCRIPTION')}
+ )} + +
+ + +
+ {/* 文章列表 */} +
+ {posts?.map(post => ( + + ))} +
+
+
+ ) } diff --git a/themes/commerce/config.js b/themes/commerce/config.js index 3b68230d..8315ac97 100644 --- a/themes/commerce/config.js +++ b/themes/commerce/config.js @@ -2,15 +2,15 @@ const CONFIG = { // 封面大图 COMMERCE_HOME_BANNER_ENABLE: true, - COMMERCE_TEXT_CENTER_TITLE: 'Product Center', //中间产品区块标题 + COMMERCE_TEXT_CENTER_TITLE: 'Product Center', // 中间产品区块标题 COMMERCE_TEXT_CENTER_DESCRIPTION: 'The vision of NotionNext is to help you effortlessly and seamlessly build your own website, amplifying the value of your brand.', // 中间产品区块文字描述 - COMMERCE_TEXT_CENTER_CATEGORY_TITLE: 'Product Categories', //左侧产品分类标题 + COMMERCE_TEXT_CENTER_CATEGORY_TITLE: 'Product Categories', // 左侧产品分类标题 COMMERCE_TEXT_FOOTER_TITLE: 'Contact US', // COMMERCE主题页脚文案标题;按Shift+Enter键可以换行 - COMMERCE_TEXT_FOOTER_MENU_1: 'Product Center', //COMMERCE主题页脚左侧菜单标题1 - COMMERCE_TEXT_FOOTER_MENU_2: 'About US', //COMMERCE主题页脚左侧菜单标题2 - COMMERCE_HOME_POSTS_COUNT: 9, //首页展示商品数 - COMMERCE_CONTACT_WHATSAPP_SHOW: true, //是否展示whatsapp联系按钮 请配置 CONTACT_WHATSAPP - COMMERCE_CONTACT_TELEGRAM_SHOW: true //联系栏展示telegram按钮 请配置 CONTACT_TELEGRAM + COMMERCE_TEXT_FOOTER_MENU_1: 'Product Center', // COMMERCE主题页脚左侧菜单标题1 + COMMERCE_TEXT_FOOTER_MENU_2: 'About US', // COMMERCE主题页脚左侧菜单标题2 + COMMERCE_HOME_POSTS_COUNT: 9, // 首页展示商品数 + COMMERCE_CONTACT_WHATSAPP_SHOW: true, // 是否展示whatsapp联系按钮 请配置 CONTACT_WHATSAPP + COMMERCE_CONTACT_TELEGRAM_SHOW: true // 联系栏展示telegram按钮 请配置 CONTACT_TELEGRAM } export default CONFIG diff --git a/themes/commerce/index.js b/themes/commerce/index.js index 4e8c76c0..4ee9d726 100644 --- a/themes/commerce/index.js +++ b/themes/commerce/index.js @@ -256,16 +256,17 @@ const LayoutSlug = props => {
+ className='md:w-1/2 flex justify-center items-center border'>
-
+
{post?.title}
-
{post?.summary}
+
)}