From fc1e6441305a5cd77d34389a32e14a6b799e1f61 Mon Sep 17 00:00:00 2001 From: anime Date: Sun, 6 Jul 2025 02:51:21 +0800 Subject: [PATCH 1/4] feat(ArticleCopyright): initially implement the "not by AI" function --- components/NotByAI.js | 17 +++++ ...Written-By-Human-Not-By-AI-Badge-black.svg | 56 +++++++++++++++ ...Written-By-Human-Not-By-AI-Badge-white.svg | 56 +++++++++++++++ ...Written-By-Human-Not-By-AI-Badge-black.svg | 71 +++++++++++++++++++ ...Written-By-Human-Not-By-AI-Badge-white.svg | 71 +++++++++++++++++++ ...Written-By-Human-Not-By-AI-Badge-black.svg | 71 +++++++++++++++++++ ...Written-By-Human-Not-By-AI-Badge-white.svg | 71 +++++++++++++++++++ ...Written-By-Human-Not-By-AI-Badge-black.svg | 52 ++++++++++++++ ...Written-By-Human-Not-By-AI-Badge-white.svg | 52 ++++++++++++++ ...Written-By-Human-Not-By-AI-Badge-black.svg | 52 ++++++++++++++ ...Written-By-Human-Not-By-AI-Badge-white.svg | 52 ++++++++++++++ ...Written-By-Human-Not-By-AI-Badge-black.svg | 61 ++++++++++++++++ ...Written-By-Human-Not-By-AI-Badge-white.svg | 61 ++++++++++++++++ ...Written-By-Human-Not-By-AI-Badge-black.svg | 61 ++++++++++++++++ ...Written-By-Human-Not-By-AI-Badge-white.svg | 61 ++++++++++++++++ .../commerce/components/ArticleCopyright.js | 20 ++++-- themes/heo/components/PostCopyright.js | 4 ++ themes/hexo/components/ArticleCopyright.js | 20 ++++-- themes/matery/components/ArticleCopyright.js | 16 +++-- themes/next/components/ArticleCopyright.js | 16 +++-- 20 files changed, 915 insertions(+), 26 deletions(-) create mode 100644 components/NotByAI.js create mode 100644 public/svg/not-by-ai/en-US/Written-By-Human-Not-By-AI-Badge-black.svg create mode 100644 public/svg/not-by-ai/en-US/Written-By-Human-Not-By-AI-Badge-white.svg create mode 100644 public/svg/not-by-ai/fr-FR/Written-By-Human-Not-By-AI-Badge-black.svg create mode 100644 public/svg/not-by-ai/fr-FR/Written-By-Human-Not-By-AI-Badge-white.svg create mode 100644 public/svg/not-by-ai/ja-JP/Written-By-Human-Not-By-AI-Badge-black.svg create mode 100644 public/svg/not-by-ai/ja-JP/Written-By-Human-Not-By-AI-Badge-white.svg create mode 100644 public/svg/not-by-ai/tr-TR/Written-By-Human-Not-By-AI-Badge-black.svg create mode 100644 public/svg/not-by-ai/tr-TR/Written-By-Human-Not-By-AI-Badge-white.svg create mode 100644 public/svg/not-by-ai/zh-CN/Written-By-Human-Not-By-AI-Badge-black.svg create mode 100644 public/svg/not-by-ai/zh-CN/Written-By-Human-Not-By-AI-Badge-white.svg create mode 100644 public/svg/not-by-ai/zh-HK/Written-By-Human-Not-By-AI-Badge-black.svg create mode 100644 public/svg/not-by-ai/zh-HK/Written-By-Human-Not-By-AI-Badge-white.svg create mode 100644 public/svg/not-by-ai/zh-TW/Written-By-Human-Not-By-AI-Badge-black.svg create mode 100644 public/svg/not-by-ai/zh-TW/Written-By-Human-Not-By-AI-Badge-white.svg diff --git a/components/NotByAI.js b/components/NotByAI.js new file mode 100644 index 00000000..a92921da --- /dev/null +++ b/components/NotByAI.js @@ -0,0 +1,17 @@ +import { useGlobal } from '@/lib/global' + +/** + * 版权声明 + * @returns + */ +export default function NotByAI() { + const { lang, isDarkMode } = useGlobal() + + return ( + not-by-ai + ) +} diff --git a/public/svg/not-by-ai/en-US/Written-By-Human-Not-By-AI-Badge-black.svg b/public/svg/not-by-ai/en-US/Written-By-Human-Not-By-AI-Badge-black.svg new file mode 100644 index 00000000..a9fcb382 --- /dev/null +++ b/public/svg/not-by-ai/en-US/Written-By-Human-Not-By-AI-Badge-black.svg @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/svg/not-by-ai/en-US/Written-By-Human-Not-By-AI-Badge-white.svg b/public/svg/not-by-ai/en-US/Written-By-Human-Not-By-AI-Badge-white.svg new file mode 100644 index 00000000..49cac441 --- /dev/null +++ b/public/svg/not-by-ai/en-US/Written-By-Human-Not-By-AI-Badge-white.svg @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/svg/not-by-ai/fr-FR/Written-By-Human-Not-By-AI-Badge-black.svg b/public/svg/not-by-ai/fr-FR/Written-By-Human-Not-By-AI-Badge-black.svg new file mode 100644 index 00000000..031a9abe --- /dev/null +++ b/public/svg/not-by-ai/fr-FR/Written-By-Human-Not-By-AI-Badge-black.svg @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/svg/not-by-ai/fr-FR/Written-By-Human-Not-By-AI-Badge-white.svg b/public/svg/not-by-ai/fr-FR/Written-By-Human-Not-By-AI-Badge-white.svg new file mode 100644 index 00000000..41dcd8b5 --- /dev/null +++ b/public/svg/not-by-ai/fr-FR/Written-By-Human-Not-By-AI-Badge-white.svg @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/svg/not-by-ai/ja-JP/Written-By-Human-Not-By-AI-Badge-black.svg b/public/svg/not-by-ai/ja-JP/Written-By-Human-Not-By-AI-Badge-black.svg new file mode 100644 index 00000000..0ba40b75 --- /dev/null +++ b/public/svg/not-by-ai/ja-JP/Written-By-Human-Not-By-AI-Badge-black.svg @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/svg/not-by-ai/ja-JP/Written-By-Human-Not-By-AI-Badge-white.svg b/public/svg/not-by-ai/ja-JP/Written-By-Human-Not-By-AI-Badge-white.svg new file mode 100644 index 00000000..53775d31 --- /dev/null +++ b/public/svg/not-by-ai/ja-JP/Written-By-Human-Not-By-AI-Badge-white.svg @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/svg/not-by-ai/tr-TR/Written-By-Human-Not-By-AI-Badge-black.svg b/public/svg/not-by-ai/tr-TR/Written-By-Human-Not-By-AI-Badge-black.svg new file mode 100644 index 00000000..a8fdbafe --- /dev/null +++ b/public/svg/not-by-ai/tr-TR/Written-By-Human-Not-By-AI-Badge-black.svg @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/svg/not-by-ai/tr-TR/Written-By-Human-Not-By-AI-Badge-white.svg b/public/svg/not-by-ai/tr-TR/Written-By-Human-Not-By-AI-Badge-white.svg new file mode 100644 index 00000000..4e79df1e --- /dev/null +++ b/public/svg/not-by-ai/tr-TR/Written-By-Human-Not-By-AI-Badge-white.svg @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/svg/not-by-ai/zh-CN/Written-By-Human-Not-By-AI-Badge-black.svg b/public/svg/not-by-ai/zh-CN/Written-By-Human-Not-By-AI-Badge-black.svg new file mode 100644 index 00000000..637cc2a8 --- /dev/null +++ b/public/svg/not-by-ai/zh-CN/Written-By-Human-Not-By-AI-Badge-black.svg @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/svg/not-by-ai/zh-CN/Written-By-Human-Not-By-AI-Badge-white.svg b/public/svg/not-by-ai/zh-CN/Written-By-Human-Not-By-AI-Badge-white.svg new file mode 100644 index 00000000..a0590bc8 --- /dev/null +++ b/public/svg/not-by-ai/zh-CN/Written-By-Human-Not-By-AI-Badge-white.svg @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/svg/not-by-ai/zh-HK/Written-By-Human-Not-By-AI-Badge-black.svg b/public/svg/not-by-ai/zh-HK/Written-By-Human-Not-By-AI-Badge-black.svg new file mode 100644 index 00000000..18c32c01 --- /dev/null +++ b/public/svg/not-by-ai/zh-HK/Written-By-Human-Not-By-AI-Badge-black.svg @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/svg/not-by-ai/zh-HK/Written-By-Human-Not-By-AI-Badge-white.svg b/public/svg/not-by-ai/zh-HK/Written-By-Human-Not-By-AI-Badge-white.svg new file mode 100644 index 00000000..872377df --- /dev/null +++ b/public/svg/not-by-ai/zh-HK/Written-By-Human-Not-By-AI-Badge-white.svg @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/svg/not-by-ai/zh-TW/Written-By-Human-Not-By-AI-Badge-black.svg b/public/svg/not-by-ai/zh-TW/Written-By-Human-Not-By-AI-Badge-black.svg new file mode 100644 index 00000000..18c32c01 --- /dev/null +++ b/public/svg/not-by-ai/zh-TW/Written-By-Human-Not-By-AI-Badge-black.svg @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/svg/not-by-ai/zh-TW/Written-By-Human-Not-By-AI-Badge-white.svg b/public/svg/not-by-ai/zh-TW/Written-By-Human-Not-By-AI-Badge-white.svg new file mode 100644 index 00000000..872377df --- /dev/null +++ b/public/svg/not-by-ai/zh-TW/Written-By-Human-Not-By-AI-Badge-white.svg @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/themes/commerce/components/ArticleCopyright.js b/themes/commerce/components/ArticleCopyright.js index 67c65bab..0d95536a 100644 --- a/themes/commerce/components/ArticleCopyright.js +++ b/themes/commerce/components/ArticleCopyright.js @@ -4,8 +4,9 @@ import { useRouter } from 'next/router' import { useEffect, useState } from 'react' import CONFIG from '../config' import { siteConfig } from '@/lib/config' +import NotByAI from '@/components/NotByAI' -export default function ArticleCopyright () { +export default function ArticleCopyright() { const router = useRouter() const [path, setPath] = useState(siteConfig('LINK') + router.asPath) useEffect(() => { @@ -19,17 +20,19 @@ export default function ArticleCopyright () { } return ( -
-
) diff --git a/themes/hexo/components/ArticleCopyright.js b/themes/hexo/components/ArticleCopyright.js index af3808a2..63aa69c6 100644 --- a/themes/hexo/components/ArticleCopyright.js +++ b/themes/hexo/components/ArticleCopyright.js @@ -4,8 +4,9 @@ import { useRouter } from 'next/router' import { useEffect, useState } from 'react' import CONFIG from '../config' import { siteConfig } from '@/lib/config' +import NotByAI from '@/components/NotByAI' -export default function ArticleCopyright () { +export default function ArticleCopyright() { const router = useRouter() const [path, setPath] = useState(siteConfig('LINK') + router.asPath) useEffect(() => { @@ -19,17 +20,19 @@ export default function ArticleCopyright () { } return ( -
-
) diff --git a/themes/hexo/config.js b/themes/hexo/config.js index c4b0be31..a6fc222a 100644 --- a/themes/hexo/config.js +++ b/themes/hexo/config.js @@ -32,6 +32,7 @@ const CONFIG = { HEXO_ARTICLE_ADJACENT: true, // 显示上一篇下一篇文章推荐 HEXO_ARTICLE_COPYRIGHT: true, // 显示文章版权声明 + HEXO_ARTICLE_NOT_BY_AI: false, // 显示非AI写作 HEXO_ARTICLE_RECOMMEND: true, // 文章关联推荐 HEXO_WIDGET_LATEST_POSTS: true, // 显示最新文章卡 diff --git a/themes/matery/components/ArticleCopyright.js b/themes/matery/components/ArticleCopyright.js index 31817c68..64fe19e5 100644 --- a/themes/matery/components/ArticleCopyright.js +++ b/themes/matery/components/ArticleCopyright.js @@ -38,9 +38,11 @@ export default function ArticleCopyright() { {locale.COMMON.COPYRIGHT}: {locale.COMMON.COPYRIGHT_NOTICE} -
  • - -
  • + {siteConfig('MATERY_ARTICLE_NOT_BY_AI', false, CONFIG) && ( +
  • + +
  • + )} ) diff --git a/themes/matery/config.js b/themes/matery/config.js index 705d3765..5835051c 100644 --- a/themes/matery/config.js +++ b/themes/matery/config.js @@ -1,7 +1,12 @@ const CONFIG = { MATERY_HOME_BANNER_ENABLE: true, // 3.14.1以后的版本中,欢迎语在blog.config.js中配置,用英文逗号','隔开多个。 - MATERY_HOME_BANNER_GREETINGS: ['Hi,我是一个程序员', 'Hi,我是一个打工人', 'Hi,我是一个干饭人', '欢迎来到我的博客🎉'], // 首页大图标语文字 + MATERY_HOME_BANNER_GREETINGS: [ + 'Hi,我是一个程序员', + 'Hi,我是一个打工人', + 'Hi,我是一个干饭人', + '欢迎来到我的博客🎉' + ], // 首页大图标语文字 MATERY_HOME_NAV_BUTTONS: true, // 首页是否显示分类大图标按钮 MATERY_HOME_NAV_BACKGROUND_IMG_FIXED: false, // 首页背景图滚动时是否固定,true 则滚动时图片不懂; false则随鼠标滚动 @@ -21,6 +26,7 @@ const CONFIG = { MATERY_ARTICLE_ADJACENT: true, // 显示上一篇下一篇文章推荐 MATERY_ARTICLE_COPYRIGHT: true, // 显示文章版权声明 + MATERY_ARTICLE_NOT_BY_AI: false, // 显示非AI写作 MATERY_ARTICLE_RECOMMEND: true, // 文章关联推荐 MATERY_WIDGET_LATEST_POSTS: true, // 显示最新文章卡 diff --git a/themes/next/components/ArticleCopyright.js b/themes/next/components/ArticleCopyright.js index dfd70332..6626713c 100644 --- a/themes/next/components/ArticleCopyright.js +++ b/themes/next/components/ArticleCopyright.js @@ -28,9 +28,11 @@ export default function ArticleCopyright({ author, url }) { {locale.COMMON.COPYRIGHT}: {locale.COMMON.COPYRIGHT_NOTICE} -
  • - -
  • + {siteConfig('NEXT_ARTICLE_NOT_BY_AI', false, CONFIG) && ( +
  • + +
  • + )} ) diff --git a/themes/next/config.js b/themes/next/config.js index f6f20559..330dedd2 100644 --- a/themes/next/config.js +++ b/themes/next/config.js @@ -38,6 +38,7 @@ const CONFIG = { NEXT_ARTICLE_RELATE_POSTS: true, // 相关文章推荐 NEXT_ARTICLE_COPYRIGHT: true, // 文章版权声明 + NEXT_ARTICLE_NOT_BY_AI: false, // 显示非AI写作 NEXT_ARTICLE_INFO: true // 显示文章信息 } From 13d02176a4f37ae41a0f5150a9816eb545225d4c Mon Sep 17 00:00:00 2001 From: anime Date: Sun, 6 Jul 2025 03:36:36 +0800 Subject: [PATCH 4/4] feat(NotByAI): add commerce theme configuration options to maintain consistency with other themes --- themes/commerce/components/ArticleCopyright.js | 4 ++-- themes/commerce/config.js | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/themes/commerce/components/ArticleCopyright.js b/themes/commerce/components/ArticleCopyright.js index 2c559a5b..b418a655 100644 --- a/themes/commerce/components/ArticleCopyright.js +++ b/themes/commerce/components/ArticleCopyright.js @@ -15,7 +15,7 @@ export default function ArticleCopyright() { const { locale } = useGlobal() - if (!CONFIG.ARTICLE_COPYRIGHT) { + if (!siteConfig('COMMERCE_ARTICLE_COPYRIGHT', null, CONFIG)) { return <> } @@ -40,7 +40,7 @@ export default function ArticleCopyright() { {locale.COMMON.COPYRIGHT}: {locale.COMMON.COPYRIGHT_NOTICE} - {siteConfig('ARTICLE_NOT_BY_AI', false, CONFIG) && ( + {siteConfig('COMMERCE_ARTICLE_NOT_BY_AI', false, CONFIG) && (
  • diff --git a/themes/commerce/config.js b/themes/commerce/config.js index 4c3e872a..c0f147ae 100644 --- a/themes/commerce/config.js +++ b/themes/commerce/config.js @@ -15,6 +15,9 @@ const CONFIG = { COMMERCE_HOME_POSTS_COUNT: 9, // 首页展示商品数 COMMERCE_CONTACT_WHATSAPP_SHOW: true, // 是否展示whatsapp联系按钮 请配置 CONTACT_WHATSAPP - COMMERCE_CONTACT_TELEGRAM_SHOW: true // 联系栏展示telegram按钮 请配置 CONTACT_TELEGRAM + COMMERCE_CONTACT_TELEGRAM_SHOW: true, // 联系栏展示telegram按钮 请配置 CONTACT_TELEGRAM + + COMMERCE_ARTICLE_COPYRIGHT: true, // 文章版权声明 + COMMERCE_ARTICLE_NOT_BY_AI: false // 显示非AI写作 } export default CONFIG