diff --git a/lib/config.js b/lib/config.js index ee56f91d..8002e046 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) { diff --git a/public/qrcode.png b/public/qrcode.png new file mode 100644 index 00000000..f3b361b4 Binary files /dev/null and b/public/qrcode.png differ diff --git a/themes/commerce/components/Footer.js b/themes/commerce/components/Footer.js index a8efec25..1f3c6b6b 100644 --- a/themes/commerce/components/Footer.js +++ b/themes/commerce/components/Footer.js @@ -1,121 +1,229 @@ import { siteConfig } from '@/lib/config' import Link from 'next/link' +import CONFIG from '../config' /** * 页脚 * @param {*} param0 * @returns */ -const Footer = (props) => { +const Footer = props => { const d = new Date() const currentYear = d.getFullYear() const since = siteConfig('SINCE') - const copyrightDate = parseInt(since) < currentYear ? since + '-' + currentYear : currentYear + const copyrightDate = + parseInt(since) < currentYear ? since + '-' + currentYear : currentYear const { categoryOptions, customMenu } = props - return + ) } export default Footer 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..4c3e872a 100644 --- a/themes/commerce/config.js +++ b/themes/commerce/config.js @@ -2,15 +2,19 @@ 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_FOOTER_RIGHT_IMG_URL: null, // 显示页脚右侧的图片,通常放二维码 + COMMERCE_FOOTER_RIGHT_TEXT: null, // 页脚右侧图片下的文字描述 + + 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}
+
)}