From a8bf116c83caa6f06a1bc3ba4406ff03056da6f5 Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Tue, 7 May 2024 17:11:19 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B7=B2=E7=9F=A5bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/config.js | 4 +- themes/commerce/components/ProductCenter.js | 56 ++++++++++++++------- themes/commerce/config.js | 14 +++--- themes/commerce/index.js | 7 +-- 4 files changed, 51 insertions(+), 30 deletions(-) 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}
+
)} From 2ed166405a4e3fedeff3daec573ee9d43906bf56 Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Tue, 7 May 2024 17:28:57 +0800 Subject: [PATCH 2/3] =?UTF-8?q?commerce=E4=B8=BB=E9=A2=98=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E4=BA=8C=E7=BB=B4=E7=A0=81=E5=92=8C=E6=96=87=E5=AD=97?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/qrcode.png | Bin 0 -> 2305 bytes themes/commerce/components/Footer.js | 300 ++++++++++++++++++--------- themes/commerce/config.js | 4 + 3 files changed, 205 insertions(+), 99 deletions(-) create mode 100644 public/qrcode.png diff --git a/public/qrcode.png b/public/qrcode.png new file mode 100644 index 0000000000000000000000000000000000000000..f3b361b4b61c0e86d7964fae32a9afe0cf3798ce GIT binary patch literal 2305 zcmb7GYfuwc7)`JeM3(rdhz7cf4;;0M6-`t~RHOl6#HkhpT0(|u@CC7SDlm}ESXjhh z5UbQcN{Y5JPO!n(6e?FAONv3JH8+gh-W5;j~BK=*40*HpBdbkE)1|;OpK}NF<;; z8~A>0UY~t5vt!okMN$8EVqfo^7#SG>n}pRZHILVQRRoy$5iIuLqO%%7^Y|`0k4U|s zKluH=t#CSV!HMbL_yn9;{GQ3oQ>EyPGA_X@ZIG`zq-v?flV~tp>7vzP^yvMWS0&l(d2w! zZi>eOD@Q|hNepK`y8a0z2%STvxx>*zD)ML}JM;N@+`38-z1lP*5q;{C$wvH6CV^os zZzF3^QGkXc4B8Rn2Ei>o4D3vemd-|l{E$XM{CAd|pEH?&8n)7bun_p-ON`-3gV6Z@R z8~wZm%0H-B*oTLEHTWR;HEd0(VIgB`YT4C#`UXyxJwWx;?2S26>=8X?Yo+6n*f5PK zO?V(u->Of$2-MXEF%nJoqyG%qMd2#>C5Vkj{kq@>o9LQ#j2{n-wJQMAxE~AESe~W7 zvG;clJ+4k;u@${BIUdzE*=Y3A&^bcMf*b5XwtYOOwD#2fV03YPO|xi=JJo$%;kAA0 zZg;t4cNYMfbzGl&7ShQiOl5K3p&>G!fKr*6TTE?G;Iv8_qsltuj#>dHHI9E=R)mCr zl4cR=fIBZ34%0Yz$F~%s1NR?VW@^*NIQn2f*DT&Zb%4Gp8 z<0_JuDzXu`qmH7*lPqSnG#w)$Omesh?GYp9hu(@WQzEI>B{K67#oGO2sYeXG)ehI5MwpF| z`33B#Q@9r$LoSyYaZ { +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/config.js b/themes/commerce/config.js index 8315ac97..4c3e872a 100644 --- a/themes/commerce/config.js +++ b/themes/commerce/config.js @@ -9,6 +9,10 @@ const CONFIG = { 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_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 From 6c3316873f7e0517dfd7d4d2ec1a7a7075939bc3 Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Tue, 7 May 2024 17:31:11 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BA=8C=E7=BB=B4=E7=A0=81=E6=96=87?= =?UTF-8?q?=E5=AD=97=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/config.js | 3 --- themes/commerce/components/Footer.js | 12 +++++++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/config.js b/lib/config.js index 9d2ddf39..8002e046 100644 --- a/lib/config.js +++ b/lib/config.js @@ -55,9 +55,6 @@ 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/Footer.js b/themes/commerce/components/Footer.js index d6aa5908..1f3c6b6b 100644 --- a/themes/commerce/components/Footer.js +++ b/themes/commerce/components/Footer.js @@ -149,9 +149,15 @@ const Footer = props => { )}>
-
- {siteConfig('COMMERCE_FOOTER_RIGHT_TEXT', null, CONFIG)} -
+
}