From 60892530c61db78c43b5e433e3e8ecc99922bf53 Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Wed, 15 Nov 2023 18:52:53 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix=20=E7=AB=99=E7=82=B9=E6=8F=8F=E8=BF=B0?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/ISSUE_TEMPLATE/bug_report.md | 18 +++++++++--------- pages/archive/index.js | 2 +- pages/category/[category]/index.js | 2 +- pages/category/[category]/page/[page].js | 2 +- pages/category/index.js | 2 +- pages/page/[page].js | 2 +- pages/search/index.js | 2 +- pages/tag/[tag]/index.js | 2 +- pages/tag/[tag]/page/[page].js | 2 +- pages/tag/index.js | 2 +- themes/matery/components/SideBar.js | 2 +- themes/nobelium/components/Nav.js | 2 +- themes/nobelium/components/Title.js | 2 +- themes/plog/components/LogoBar.js | 4 ++-- themes/plog/components/Title.js | 2 +- themes/simple/components/Header.js | 2 +- themes/simple/components/Title.js | 2 +- 17 files changed, 26 insertions(+), 26 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 943cf303ce5..4ea399c08fb 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -12,23 +12,23 @@ assignees: tangly1024 --> **描述bug** -简单说明bug的现象、相关的错误提示、日志等 +【此项必填】简单说明bug的现象、相关的错误提示、日志等 **复现步骤** -出现这个bug的操作步骤 +【此项必填】出现这个bug的操作步骤 **期望的正常结果** -希望按这个步骤,正常操作结果是什么 +【此项必填】希望按这个步骤,正常操作结果是什么 **截图** -相关的页面,应该的结果 +【可选】相关的页面,应该的结果 **环境** -- 操作系统: [例如. iOS, Android, macOS, windows] -- 浏览器 [例如. chrome, safari, firefox] -- NotionNext版本 [e.g. 3.13.6] -- 主题 [例如. hexo] +- 【必填】NotionNext版本 [例如. 4.0.18] +- 【必填】主题 [例如. hexo] +- 【可选】操作系统: [例如. iOS, Android, macOS, windows] +- 【可选】浏览器 [例如. chrome, safari, firefox] **补充说明** -与问题相关的其它说明 \ No newline at end of file +【可选】与问题相关的其它说明 \ No newline at end of file diff --git a/pages/archive/index.js b/pages/archive/index.js index 662cb7b68b6..a0a57f28c6c 100644 --- a/pages/archive/index.js +++ b/pages/archive/index.js @@ -31,7 +31,7 @@ const ArchiveIndex = props => { const meta = { title: `${locale.NAV.ARCHIVE} | ${siteConfig('TITLE')}`, - description: siteConfig('HOME_BANNER_IMAGE'), + description: siteConfig('DESCRIPTION'), image: siteInfo?.pageCover, slug: 'archive', type: 'website' diff --git a/pages/category/[category]/index.js b/pages/category/[category]/index.js index 9c90f22d399..a623cc6ba5d 100644 --- a/pages/category/[category]/index.js +++ b/pages/category/[category]/index.js @@ -22,7 +22,7 @@ export default function Category(props) { title: `${props.category} | ${locale.COMMON.CATEGORY} | ${ siteConfig('TITLE') || '' }`, - description: siteConfig('HOME_BANNER_IMAGE'), + description: siteConfig('DESCRIPTION'), slug: 'category/' + props.category, image: siteInfo?.pageCover, type: 'website' diff --git a/pages/category/[category]/page/[page].js b/pages/category/[category]/page/[page].js index dee16235b10..ae5124b14b9 100644 --- a/pages/category/[category]/page/[page].js +++ b/pages/category/[category]/page/[page].js @@ -22,7 +22,7 @@ export default function Category(props) { title: `${props.category} | ${locale.COMMON.CATEGORY} | ${ siteConfig('TITLE') || '' }`, - description: siteConfig('HOME_BANNER_IMAGE'), + description: siteConfig('DESCRIPTION'), slug: 'category/' + props.category, image: siteInfo?.pageCover, type: 'website' diff --git a/pages/category/index.js b/pages/category/index.js index 78e7676e361..85121910825 100644 --- a/pages/category/index.js +++ b/pages/category/index.js @@ -20,7 +20,7 @@ export default function Category(props) { const meta = { title: `${locale.COMMON.CATEGORY} | ${siteConfig('TITLE')}`, - description: siteConfig('HOME_BANNER_IMAGE'), + description: siteConfig('DESCRIPTION'), image: siteInfo?.pageCover, slug: 'category', type: 'website' diff --git a/pages/page/[page].js b/pages/page/[page].js index 6e83c5a691a..c34aef1dd5c 100644 --- a/pages/page/[page].js +++ b/pages/page/[page].js @@ -18,7 +18,7 @@ const Page = props => { const meta = { title: `${props?.page} | Page | ${siteConfig('TITLE')}`, - description: siteConfig('HOME_BANNER_IMAGE'), + description: siteConfig('DESCRIPTION'), image: siteInfo?.pageCover, slug: 'page/' + props.page, type: 'website' diff --git a/pages/search/index.js b/pages/search/index.js index 1504fe86800..fa45d2d5c88 100644 --- a/pages/search/index.js +++ b/pages/search/index.js @@ -36,7 +36,7 @@ const Search = props => { const meta = { title: `${keyword || ''}${keyword ? ' | ' : ''}${locale.NAV.SEARCH} | ${siteConfig('TITLE')}`, - description: siteConfig('HOME_BANNER_IMAGE'), + description: siteConfig('DESCRIPTION'), image: siteInfo?.pageCover, slug: 'search', type: 'website' diff --git a/pages/tag/[tag]/index.js b/pages/tag/[tag]/index.js index 8805c686d99..1d6c94d2e72 100644 --- a/pages/tag/[tag]/index.js +++ b/pages/tag/[tag]/index.js @@ -19,7 +19,7 @@ const Tag = props => { const meta = { title: `${tag} | ${locale.COMMON.TAGS} | ${siteConfig('TITLE')}`, - description: siteConfig('HOME_BANNER_IMAGE'), + description: siteConfig('DESCRIPTION'), image: siteInfo?.pageCover, slug: 'tag/' + tag, type: 'website' diff --git a/pages/tag/[tag]/page/[page].js b/pages/tag/[tag]/page/[page].js index 7cbb2e6a229..ab28fdbc5fe 100644 --- a/pages/tag/[tag]/page/[page].js +++ b/pages/tag/[tag]/page/[page].js @@ -14,7 +14,7 @@ const Tag = props => { const meta = { title: `${tag} | ${locale.COMMON.TAGS} | ${siteConfig('TITLE')}`, - description: siteConfig('HOME_BANNER_IMAGE'), + description: siteConfig('DESCRIPTION'), image: siteInfo?.pageCover, slug: 'tag/' + tag, type: 'website' diff --git a/pages/tag/index.js b/pages/tag/index.js index f82613ebaa7..bb618414a28 100644 --- a/pages/tag/index.js +++ b/pages/tag/index.js @@ -19,7 +19,7 @@ const TagIndex = props => { const meta = { title: `${locale.COMMON.TAGS} | ${siteConfig('TITLE')}`, - description: siteConfig('HOME_BANNER_IMAGE'), + description: siteConfig('DESCRIPTION'), image: siteInfo?.pageCover, slug: 'tag', type: 'website' diff --git a/themes/matery/components/SideBar.js b/themes/matery/components/SideBar.js index 818c96b1c20..06437d137ab 100644 --- a/themes/matery/components/SideBar.js +++ b/themes/matery/components/SideBar.js @@ -18,7 +18,7 @@ const SideBar = (props) => {
{siteConfig('TITLE')}
-
{siteConfig('HOME_BANNER_IMAGE')}
+
{siteConfig('DESCRIPTION')}
diff --git a/themes/nobelium/components/Nav.js b/themes/nobelium/components/Nav.js index b050a0f5ec7..dfa4046b84d 100644 --- a/themes/nobelium/components/Nav.js +++ b/themes/nobelium/components/Nav.js @@ -63,7 +63,7 @@ const Nav = props => { : (

{siteConfig('TITLE')} - {/* ,{' '}{siteConfig('HOME_BANNER_IMAGE')} */} + {/* ,{' '}{siteConfig('DESCRIPTION')} */}

)} diff --git a/themes/nobelium/components/Title.js b/themes/nobelium/components/Title.js index a1512af2a59..151d736e4a3 100644 --- a/themes/nobelium/components/Title.js +++ b/themes/nobelium/components/Title.js @@ -7,7 +7,7 @@ import { siteConfig } from '@/lib/config' */ export const Title = (props) => { const { post } = props - const title = post?.title || siteConfig('HOME_BANNER_IMAGE') + const title = post?.title || siteConfig('DESCRIPTION') const description = post?.description || siteConfig('AUTHOR') return
diff --git a/themes/plog/components/LogoBar.js b/themes/plog/components/LogoBar.js index 51a42fcfd0d..46dd855596a 100644 --- a/themes/plog/components/LogoBar.js +++ b/themes/plog/components/LogoBar.js @@ -30,8 +30,8 @@ export default function LogoBar(props) { ) : (

- {siteConfig('TITLE')} - {' '}{siteConfig('HOME_BANNER_IMAGE')} + {siteConfig('TITLE')} + {' '}{siteConfig('DESCRIPTION')}

)}
diff --git a/themes/plog/components/Title.js b/themes/plog/components/Title.js index a1512af2a59..151d736e4a3 100644 --- a/themes/plog/components/Title.js +++ b/themes/plog/components/Title.js @@ -7,7 +7,7 @@ import { siteConfig } from '@/lib/config' */ export const Title = (props) => { const { post } = props - const title = post?.title || siteConfig('HOME_BANNER_IMAGE') + const title = post?.title || siteConfig('DESCRIPTION') const description = post?.description || siteConfig('AUTHOR') return
diff --git a/themes/simple/components/Header.js b/themes/simple/components/Header.js index f448d86e84e..a5bc8988aeb 100644 --- a/themes/simple/components/Header.js +++ b/themes/simple/components/Header.js @@ -32,7 +32,7 @@ export const Header = (props) => {
-
{siteConfig('HOME_BANNER_IMAGE')}
+
{siteConfig('DESCRIPTION')}
) diff --git a/themes/simple/components/Title.js b/themes/simple/components/Title.js index a1512af2a59..151d736e4a3 100644 --- a/themes/simple/components/Title.js +++ b/themes/simple/components/Title.js @@ -7,7 +7,7 @@ import { siteConfig } from '@/lib/config' */ export const Title = (props) => { const { post } = props - const title = post?.title || siteConfig('HOME_BANNER_IMAGE') + const title = post?.title || siteConfig('DESCRIPTION') const description = post?.description || siteConfig('AUTHOR') return
From 7f8bf757b89e2564c62602d415b4229d8615ea87 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Sat, 18 Nov 2023 13:03:00 +0800 Subject: [PATCH 2/3] Fix SEO --- components/QrCode.js | 22 ++++++++++++---------- components/Twikoo.js | 17 ++++++++++------- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/components/QrCode.js b/components/QrCode.js index fa1f95a1aa6..09a203a776c 100644 --- a/components/QrCode.js +++ b/components/QrCode.js @@ -14,16 +14,18 @@ export default function QrCode({ value }) { return } loadExternalResource(qrCodeCDN, 'js').then(url => { - const QRCode = window.QRCode - qrcode = new QRCode(document.getElementById('qrcode'), { - text: value, - width: 256, - height: 256, - colorDark: '#000000', - colorLight: '#ffffff', - correctLevel: QRCode.CorrectLevel.H - }) - // console.log('二维码', qrcode, value) + const QRCode = window?.QRCode + if (typeof QRCode !== 'undefined') { + qrcode = new QRCode(document.getElementById('qrcode'), { + text: value, + width: 256, + height: 256, + colorDark: '#000000', + colorLight: '#ffffff', + correctLevel: QRCode.CorrectLevel.H + }) + // console.log('二维码', qrcode, value) + } }) return () => { if (qrcode) { diff --git a/components/Twikoo.js b/components/Twikoo.js index 58ac3c7a145..17ef8b8bf54 100644 --- a/components/Twikoo.js +++ b/components/Twikoo.js @@ -15,13 +15,16 @@ const Twikoo = ({ isDarkMode }) => { const lang = siteConfig('LANG') useEffect(() => { - window?.twikoo?.init({ - envId: envId, // 腾讯云环境填 envId;Vercel 环境填地址(https://xxx.vercel.app) - el: el, // 容器元素 - lang: lang // 用于手动设定评论区语言,支持的语言列表 https://github.com/imaegoo/twikoo/blob/main/src/client/utils/i18n/index.js - // region: 'ap-guangzhou', // 环境地域,默认为 ap-shanghai,腾讯云环境填 ap-shanghai 或 ap-guangzhou;Vercel 环境不填 - // path: location.pathname, // 用于区分不同文章的自定义 js 路径,如果您的文章路径不是 location.pathname,需传此参数 - }) + const twikoo = window?.twikoo + if (typeof twikoo !== 'undefined' && twikoo) { + twikoo.init({ + envId: envId, // 腾讯云环境填 envId;Vercel 环境填地址(https://xxx.vercel.app) + el: el, // 容器元素 + lang: lang // 用于手动设定评论区语言,支持的语言列表 https://github.com/imaegoo/twikoo/blob/main/src/client/utils/i18n/index.js + // region: 'ap-guangzhou', // 环境地域,默认为 ap-shanghai,腾讯云环境填 ap-shanghai 或 ap-guangzhou;Vercel 环境不填 + // path: location.pathname, // 用于区分不同文章的自定义 js 路径,如果您的文章路径不是 location.pathname,需传此参数 + }) + } }, [isDarkMode]) return (
From 27589ab7d17c1502b6118639b25392f35222436c Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Sat, 18 Nov 2023 13:23:42 +0800 Subject: [PATCH 3/3] FIX SEO --- components/Twikoo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Twikoo.js b/components/Twikoo.js index 17ef8b8bf54..6899cfaa58f 100644 --- a/components/Twikoo.js +++ b/components/Twikoo.js @@ -16,7 +16,7 @@ const Twikoo = ({ isDarkMode }) => { const lang = siteConfig('LANG') useEffect(() => { const twikoo = window?.twikoo - if (typeof twikoo !== 'undefined' && twikoo) { + if (typeof twikoo !== 'undefined' && twikoo && typeof twikoo.init === 'function') { twikoo.init({ envId: envId, // 腾讯云环境填 envId;Vercel 环境填地址(https://xxx.vercel.app) el: el, // 容器元素