diff --git a/README.md b/README.md index 5621da75..6e531429 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ 访问帮助:[NotionNext帮助手册](https://docs.tangly1024.com/) -> 本项目教程为免费、公开资源,仅限个人学习使用。严禁任何个人或组织将本教程用于商业用途,包括但不限于直接售卖、间接收费、或其他变相盈利行为。转载、复制或介绍本教程内容时,须保留作者信息并明确注明来源。 +> 本项目教程为免费、公开资源,仅限个人学习使用,禁止利用本教程建立的博客发布非法内容、进行违法犯罪活动。严禁任何个人或组织将本教程用于商业用途,包括但不限于直接售卖、间接收费、或其他变相盈利行为。转载、复制或介绍本教程内容时,须保留作者信息并明确注明来源。 > 本项目仅提供由作者团队授权的付费咨询服务,请注意辨别,谨防诈骗行为。任何未经授权的收费服务均可能存在法律风险。 Notion是一个能让效率暴涨的生产力引擎,可以帮你书写文档、管理笔记,搭建知识库,甚至可以为你规划项目、时间管理、组织团队、提高生产力、还有当前最强大的AI技术加持。 @@ -52,142 +52,9 @@ Notion是一个能让效率暴涨的生产力引擎,可以帮你书写文档 ## 贡献者 - - - - - - - +感谢所有为 NotionNext 做出贡献的人! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- tangly1024
tangly1024

🎫 🔧 🐛 -
- uWayLu
uWayLu

🔧 🐛 -
- txs
txs

🔧 🐛 -
- yuzhanglong
yuzhanglong

🔧 🐛 -
- Hscpro
Hscpro

🔧 🐛 -
- JensonMiao
JensonMiao

🔧 🐛 -
- haixin1225
haixin1225

🔧 🐛 -
- mouyase
mouyase

🔧 🐛 -
- qfdk
qfdk

🔧 🐛 -
- ifyz
ifyz

🔧 🐛 -
- Liqun Zhao
Liqun Zhao

🔧 🐛 -
- Ylarod
Ylarod

🔧 🐛 -
- Etherrreal.
Etherrreal.

🔧 🐛 -
- Joshua Astray
Joshua Astray

🔧 🐛 -
- Vixcity
Vixcity

🔧 🐛 -
- ipatpat
ipatpat

🔧 🐛 -
- xloong
xloong

🔧 🐛 -
- expoli
expoli

🔧 🐛 -
- SuperHuangXu
bUBBLE

🔧 🐛 -
- Pylogmon
派了个萌

🔧 🐛 -
- SkysCrystal
Simon Shi

🔧 🐛 -
- S.Y. Lee
S.Y. Lee

🔧 🐛 -
- fighting-buf
fighting-buf

🔧 🐛 -
- cliouo
cliouo

🔧 🐛 -
- Sude Akgün
Sude Akgün

🔧 🐛 -
- Ray
Ray

🔧 🐛 -
- Hongzzz
Hongzzz

🔧 🐛 -
- RedhairHambagu
RedhairHambagu

🔧 🐛 -
- Allen
Allen

🔧 🐛 -
- zdf1230
zdf

🔧 🐛 -
- emengweb
emengweb

🔧 🐛 -
- kitety
kitety

🔧 🐛 -
-  Jiaxin Peng
Jiaxin Peng

🔧 🐛 -
+[![Contributors](https://contrib.rocks/image?repo=tangly1024/NotionNext)](https://github.com/tangly1024/NotionNext/graphs/contributors) ## 引用技术 diff --git a/README_EN.md b/README_EN.md index 488565ac..0e56f9a8 100644 --- a/README_EN.md +++ b/README_EN.md @@ -53,123 +53,9 @@ Special thanks to Craig Hart for initiating the Nobelium project. ## Contributors - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- tangly1024
tangly1024

🎫 🔧 🐛 -
- uWayLu
uWayLu

🔧 🐛 -
- txs
txs

🔧 🐛 -
- yuzhanglong
yuzhanglong

🔧 🐛 -
- Hscpro
Hscpro

🔧 🐛 -
- JensonMiao
JensonMiao

🔧 🐛 -
- haixin1225
haixin1225

🔧 🐛 -
- mouyase
mouyase

🔧 🐛 -
- qfdk
qfdk

🔧 🐛 -
- ifyz
ifyz

🔧 🐛 -
- Liqun Zhao
Liqun Zhao

🔧 🐛 -
- Ylarod
Ylarod

🔧 🐛 -
- Etherrreal.
Etherrreal.

🔧 🐛 -
- Joshua Astray
Joshua Astray

🔧 🐛 -
- Vixcity
Vixcity

🔧 🐛 -
- ipatpat
ipatpat

🔧 🐛 -
- xloong
xloong

🔧 🐛 -
- expoli
expoli

🔧 🐛 -
- SuperHuangXu
bUBBLE

🔧 🐛 -
- Pylogmon
派了个萌

🔧 🐛 -
- SkysCrystal
Simon Shi

🔧 🐛 -
- S.Y. Lee
S.Y. Lee

🔧 🐛 -
- fighting-buf
fighting-buf

🔧 🐛 -
- cliouo
cliouo

🔧 🐛 -
- Sude Akgün
Sude Akgün

🔧 🐛 -
- Ray
Ray

🔧 🐛 -
- Hongzzz
Hongzzz

🔧 🐛 -
- RedhairHambagu
RedhairHambagu

🔧 🐛 -
+This project exists thanks to all the people who contribute. +[![Contributors](https://contrib.rocks/image?repo=tangly1024/NotionNext)](https://github.com/tangly1024/NotionNext/graphs/contributors) ## Technologies Used diff --git a/components/ExternalPlugins.js b/components/ExternalPlugins.js index 4e1f7072..fd92820e 100644 --- a/components/ExternalPlugins.js +++ b/components/ExternalPlugins.js @@ -10,6 +10,9 @@ import { initGoogleAdsense } from './GoogleAdsense' import Head from 'next/head' import ExternalScript from './ExternalScript' import WebWhiz from './Webwhiz' +import { useGlobal } from '@/lib/global' +import IconFont from './IconFont' + /** * 各种插件脚本 @@ -19,6 +22,7 @@ import WebWhiz from './Webwhiz' const ExternalPlugin = props => { // 读取自Notion的配置 const { NOTION_CONFIG } = props + const {lang} = useGlobal() const DISABLE_PLUGIN = siteConfig('DISABLE_PLUGIN', null, NOTION_CONFIG) const THEME_SWITCH = siteConfig('THEME_SWITCH', null, NOTION_CONFIG) const DEBUG = siteConfig('DEBUG', null, NOTION_CONFIG) @@ -124,6 +128,8 @@ const ExternalPlugin = props => { NOTION_CONFIG ) + const ENABLE_ICON_FONT = siteConfig('ENABLE_ICON_FONT', false) + // 自定义样式css和js引入 if (isBrowser) { // 初始化AOS动画 @@ -165,8 +171,8 @@ const ExternalPlugin = props => { } setTimeout(() => { - // 将notion-id格式的url转成自定义slug - convertInnerUrl(props?.allNavPages) + // 映射url + convertInnerUrl({ allPages:props?.allNavPages, lang:lang }) }, 500) }, [router]) @@ -184,6 +190,7 @@ const ExternalPlugin = props => { <> {/* 全局样式嵌入 */} + {ENABLE_ICON_FONT && } {MOUSE_FOLLOW && } {THEME_SWITCH && } {DEBUG && } diff --git a/components/IconFont.js b/components/IconFont.js new file mode 100644 index 00000000..a363eae8 --- /dev/null +++ b/components/IconFont.js @@ -0,0 +1,56 @@ +import { siteConfig } from '@/lib/config' +import { loadExternalResource } from '@/lib/utils' +import { useRouter } from 'next/router' +import { useEffect } from 'react' + +/** + * iconfont + */ +export default function IconFont() { + const router = useRouter() + + useEffect(() => { + loadExternalResource('/webfonts/iconfont.js') + .then(u => { + console.log('iconfont loaded'); + + // 查找所有 标签且 class 包含 'icon-' + const iElements = document.querySelectorAll('i[class*="icon-"]'); + iElements.forEach(element => { + const className = Array.from(element.classList).find(cls => cls.startsWith('icon-')); + if (className) { + // 创建新的 元素 + const svgElement = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); + svgElement.setAttribute('class', 'icon'); + svgElement.setAttribute('aria-hidden', 'true'); + + const useElement = document.createElementNS('http://www.w3.org/2000/svg', 'use'); + useElement.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', `#${className}`); + svgElement.appendChild(useElement); + + // 替换原来的 元素 + element.replaceWith(svgElement); + console.log(`Replaced with class "${className}" to `); + } + }); + }) + .catch(error => { + console.warn('Failed to load iconfont.js:', error); + }); + }, [router]); + + return +} diff --git a/components/ShareButtons.js b/components/ShareButtons.js index 29fd37b4..47c32d82 100644 --- a/components/ShareButtons.js +++ b/components/ShareButtons.js @@ -37,6 +37,8 @@ import { TumblrShareButton, TwitterIcon, TwitterShareButton, + ThreadsIcon, + ThreadsShareButton, ViberIcon, ViberShareButton, VKIcon, @@ -312,6 +314,16 @@ const ShareButtons = ({ post }) => { ) + case 'threads': + return ( + + + + ) case 'qq': return ( - + {siteConfig('BEI_AN')}
diff --git a/themes/gitbook/components/Footer.js b/themes/gitbook/components/Footer.js index b9929d64..cbf6df14 100644 --- a/themes/gitbook/components/Footer.js +++ b/themes/gitbook/components/Footer.js @@ -33,7 +33,7 @@ const Footer = ({ siteInfo }) => { {siteConfig('BEI_AN') && ( <> {' '} - + {siteConfig('BEI_AN')} diff --git a/themes/heo/components/Footer.js b/themes/heo/components/Footer.js index 2bd1bf64..1a7e6fb8 100644 --- a/themes/heo/components/Footer.js +++ b/themes/heo/components/Footer.js @@ -9,6 +9,7 @@ import SocialButton from './SocialButton' */ const Footer = () => { const BEI_AN = siteConfig('BEI_AN') + const BEI_AN_LINK = siteConfig('BEI_AN_LINK') const BIO = siteConfig('BIO') return (