diff --git a/.env.local b/.env.local index 3b00243c..4d4824d5 100644 --- a/.env.local +++ b/.env.local @@ -1,5 +1,5 @@ # 环境变量 @see https://www.nextjs.cn/docs/basic-features/environment-variables -NEXT_PUBLIC_VERSION=4.6.1 +NEXT_PUBLIC_VERSION=4.7.0 # 可在此添加环境变量,去掉最左边的(# )注释即可 diff --git a/.github/workflows/docker-ghcr.yaml b/.github/workflows/docker-ghcr.yaml index db58d8d8..c2a4b38e 100644 --- a/.github/workflows/docker-ghcr.yaml +++ b/.github/workflows/docker-ghcr.yaml @@ -28,16 +28,16 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3 # Login against a Docker registry except on PR # https://github.com/docker/login-action - name: Log into registry ${{ env.REGISTRY }} if: github.event_name != 'pull_request' - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} @@ -47,14 +47,14 @@ jobs: # https://github.com/docker/metadata-action - name: Extract Docker metadata id: meta - uses: docker/metadata-action@v3 + uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} # Build and push Docker image with Buildx (don't push on PR) # https://github.com/docker/build-push-action - name: Build and push Docker image - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: context: . platforms: linux/amd64,linux/arm64 diff --git a/.github/workflows/pushUrl.yml b/.github/workflows/pushUrl.yml index c8a3651f..e0bc3ac9 100644 --- a/.github/workflows/pushUrl.yml +++ b/.github/workflows/pushUrl.yml @@ -24,11 +24,11 @@ jobs: runs-on: ubuntu-latest # 运行环境为最新版的Ubuntu steps: - name: 'Checkout codes' # 步骤一,获取仓库代码 - uses: actions/checkout@v2 + uses: actions/checkout@v4 # - name: 'Run baiduPush' # 步骤二,执行sh命令文件 # run: npm install && npm run baiduPush # 运行目录是仓库根目录 - name: Set up Python 3.8 - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: 3.8 diff --git a/.github/workflows/sync.yaml b/.github/workflows/sync.yaml index 038eff8d..7dcb3e16 100644 --- a/.github/workflows/sync.yaml +++ b/.github/workflows/sync.yaml @@ -17,7 +17,7 @@ jobs: steps: # Step 1: run a standard checkout action - name: Checkout target repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 # Step 2: run the sync action - name: Sync upstream changes diff --git a/.gitignore b/.gitignore index 42744c4b..b400f485 100644 --- a/.gitignore +++ b/.gitignore @@ -45,7 +45,7 @@ yarn-error.log* /public/robots.txt /public/sitemap.xml /public/rss/* - +/sitemap.xml # yarn package-lock.json diff --git a/Dockerfile b/Dockerfile index a0311720..12650294 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,6 @@ ARG NOTION_PAGE_ID +ARG NEXT_PUBLIC_THEME + # Install dependencies only when needed FROM node:18-alpine3.18 AS deps # Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. diff --git a/README.md b/README.md index 33be50b7..e857ab54 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,13 @@ +# 帮助教程 + +访问帮助:[NotionNext帮助手册](https://docs.tangly1024.com/) + +> 本项目教程为免费、公开资源,仅限个人学习使用。严禁任何个人或组织将本教程用于商业用途,包括但不限于直接售卖、间接收费、或其他变相盈利行为。转载、复制或介绍本教程内容时,须保留作者信息并明确注明来源。 +> 本项目仅提供由作者团队授权的付费咨询服务,请注意辨别,谨防诈骗行为。任何未经授权的收费服务均可能存在法律风险。 + +Notion是一个能让效率暴涨的生产力引擎,可以帮你书写文档、管理笔记,搭建知识库,甚至可以为你规划项目、时间管理、组织团队、提高生产力、还有当前最强大的AI技术加持。 +> 如果希望进一步探索Notion的功能,欢迎购买《[Notion笔记从入门到精通进阶课程](https://docs.tangly1024.com/article/notion-tutorial)》 + # NotionNext

@@ -31,20 +41,6 @@ |--|--|--|--| | [预览NEXT](https://preview.tangly1024.com/?theme=next) | [预览MEDIUM](https://preview.tangly1024.com/?theme=medium) | [预览HEXO](https://preview.tangly1024.com/?theme=hexo) | [预览FUKASAWA](https://preview.tangly1024.com/?theme=fukasawa) | -## 我要如何开始? - -只需几分钟即可搭建您的个人站点: - -- [部署教程 (支持多方案)](https://docs.tangly1024.com/) - -- [配置手册 - (自定义插件)](https://docs.tangly1024.com/article/notion-next-guide) - -- [二次开发 - (开发手册)](https://docs.tangly1024.com/article/notion-next-secondary-menu) - -- [更新指南 - (升级您的代码)](https://docs.tangly1024.com/article/how-to-update-notionnext) - -- [版本汇总 - (查询变动功能)](https://docs.tangly1024.com/article/notion-next-changelogs) - ## 致谢 感谢Craig Hart发起的Nobelium项目 diff --git a/README_EN.md b/README_EN.md index dd4063e5..488565ac 100644 --- a/README_EN.md +++ b/README_EN.md @@ -1,3 +1,15 @@ +# Free Installation and Usage Guide + +Click here to access the help documentation: NotionNext Help Manual - (Completely Free) + +## Rights Statement + +This project's tutorial is a free and open resource intended solely for personal learning use. It is strictly prohibited for any individual or organization to use this tutorial for commercial purposes, including but not limited to direct sales, indirect charges, or any other forms of profit. When reproducing, copying, or sharing this tutorial, the author's information must be retained, and the source clearly cited. + +This project only offers paid consultation services authorized by the author's team. Please be vigilant against fraud. Any unauthorized paid services may be subject to legal risks. + +You can set up your personal website in just a few minutes. Here is the link to my free tutorial: + # NotionNext

@@ -31,20 +43,6 @@ Live Demo:[https://preview.tangly1024.com/](https://preview.tangly1024.com/) |--|--|--|--| | [NEXT](https://preview.tangly1024.com/?theme=next) | [MEDIUM](https://preview.tangly1024.com/?theme=medium) | [HEXO](https://preview.tangly1024.com/?theme=hexo) | [FUKASAWA](https://preview.tangly1024.com/?theme=fukasawa) | -## Get Start! - -It only takes a few minutes to set up your personal site: - -- [Quick Deployment Tutorial - Multiple Options Available](https://docs.tangly1024.com/article/vercel-deploy-notion-next) - -- [Customization Guide - How to Configure Feature Plugins](https://docs.tangly1024.com/article/how-to-config-notion-next) - -- [Development Guide - How to Conduct Local Development](https://docs.tangly1024.com/article/how-to-develop-with-notion-next) - -- [Update Guide - How to Get the Latest Upgrade Patch](https://docs.tangly1024.com/article/how-to-update-notionnext) - -- [Version History - Check Feature Highlights for Each Version](https://docs.tangly1024.com/article/latest) - ## Acknowledgements Special thanks to Craig Hart for initiating the Nobelium project. diff --git a/blog.config.js b/blog.config.js index 6802da3f..a6e8d16e 100644 --- a/blog.config.js +++ b/blog.config.js @@ -546,7 +546,7 @@ const BLOG = { process.env.ENABLE_CACHE || process.env.npm_lifecycle_event === 'build' || process.env.npm_lifecycle_event === 'export', // 在打包过程中默认开启缓存,开发或运行时开启此功能意义不大。 - isProd: process.env.VERCEL_ENV === 'production' || process.env.EXPORT, // distinguish between development and production environment (ref: https://vercel.com/docs/environment-variables#system-environment-variables) isProd: process.env.VERCEL_ENV === 'production' // distinguish between development and production environment (ref: https://vercel.com/docs/environment-variables#system-environment-variables) + isProd: process.env.VERCEL_ENV === 'production' || process.env.EXPORT, // distinguish between development and production environment (ref: https://vercel.com/docs/environment-variables#system-environment-variables) BUNDLE_ANALYZER: process.env.ANALYZE === 'true' || false, // 是否展示编译依赖内容与大小 VERSION: process.env.NEXT_PUBLIC_VERSION // 版本号 } diff --git a/components/AOSAnimation.js b/components/AOSAnimation.js index 076ab379..7d246def 100644 --- a/components/AOSAnimation.js +++ b/components/AOSAnimation.js @@ -10,14 +10,8 @@ import { useEffect } from 'react' export default function AOSAnimation() { const initAOS = async () => { Promise.all([ - loadExternalResource( - 'https://cdn.bootcdn.net/ajax/libs/aos/2.3.4/aos.js', - 'js' - ), - loadExternalResource( - 'https://cdn.bootcdn.net/ajax/libs/aos/2.3.4/aos.css', - 'css' - ) + loadExternalResource('/js/aos.js', 'js'), + loadExternalResource('/css/aos.css', 'css') ]).then(() => { if (window.AOS) { window.AOS.init() diff --git a/components/Ackee.js b/components/Ackee.js index 2383f982..88618369 100644 --- a/components/Ackee.js +++ b/components/Ackee.js @@ -24,19 +24,19 @@ const Ackee = () => { }, { /* - * Enable or disable tracking of personal data. - * We recommend to ask the user for permission before turning this option on. - */ + * Enable or disable tracking of personal data. + * We recommend to ask the user for permission before turning this option on. + */ detailed: true, /* - * Enable or disable tracking when on localhost. - */ + * Enable or disable tracking when on localhost. + */ ignoreLocalhost: false, /* - * Enable or disable the tracking of your own visits. - * This is enabled by default, but should be turned off when using a wildcard Access-Control-Allow-Origin header. - * Some browsers strictly block third-party cookies. The option won't have an impact when this is the case. - */ + * Enable or disable the tracking of your own visits. + * This is enabled by default, but should be turned off when using a wildcard Access-Control-Allow-Origin header. + * Some browsers strictly block third-party cookies. The option won't have an impact when this is the case. + */ ignoreOwnVisits: false } ) diff --git a/components/CustomContextMenu.js b/components/CustomContextMenu.js index 8402f20e..19b65395 100644 --- a/components/CustomContextMenu.js +++ b/components/CustomContextMenu.js @@ -117,12 +117,14 @@ export default function CustomContextMenu(props) { function handleCopy() { const selectedText = document.getSelection().toString() if (selectedText) { - const tempInput = document.createElement('input') - tempInput.value = selectedText - document.body.appendChild(tempInput) - tempInput.select() - document.execCommand('copy') - document.body.removeChild(tempInput) + const tempInput = document.createElement('input'); + tempInput.value = selectedText; + document.body.appendChild(tempInput); + tempInput.select(); + document.execCommand('copy'); + if (tempInput && tempInput.parentNode && tempInput.parentNode.contains(tempInput)) { + tempInput.parentNode.removeChild(tempInput); + } // alert("Text copied: " + selectedText); } else { // alert("Please select some text first."); diff --git a/components/DifyChatbot.js b/components/DifyChatbot.js index c954a872..6190c58b 100644 --- a/components/DifyChatbot.js +++ b/components/DifyChatbot.js @@ -24,7 +24,9 @@ export default function DifyChatbot() { return () => { // 在组件卸载时清理 script 标签 const existingScript = document.getElementById(siteConfig('DIFY_CHATBOT_TOKEN')); // 注意调用 siteConfig() - if (existingScript) document.body.removeChild(existingScript); + if (existingScript && existingScript.parentNode && existingScript.parentNode.contains(existingScript)) { + existingScript.parentNode.removeChild(existingScript); + } }; }, []); // 注意依赖数组为空,意味着脚本将仅在加载页面时执行一次 diff --git a/components/ExternalPlugins.js b/components/ExternalPlugins.js index 7ee54a10..ce0b5e63 100644 --- a/components/ExternalPlugins.js +++ b/components/ExternalPlugins.js @@ -63,6 +63,7 @@ const ExternalPlugin = props => { const MOUSE_FOLLOW = siteConfig('MOUSE_FOLLOW') const CUSTOM_EXTERNAL_CSS = siteConfig('CUSTOM_EXTERNAL_CSS') const CUSTOM_EXTERNAL_JS = siteConfig('CUSTOM_EXTERNAL_JS') + const ENABLE_NPROGRSS = siteConfig('ENABLE_NPROGRSS', true) // 自定义样式css和js引入 if (isBrowser) { @@ -145,7 +146,7 @@ const ExternalPlugin = props => { {AD_WWADS_BLOCK_DETECT && } {TIANLI_KEY && } - + {ENABLE_NPROGRSS && } {ANALYTICS_51LA_ID && ANALYTICS_51LA_CK && } @@ -186,10 +187,19 @@ const ExternalPlugin = props => { async dangerouslySetInnerHTML={{ __html: ` - (function(c,l,a,r,i,t,y){ - c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; - t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; - y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); + (function(c, l, a, r, i, t, y) { + c[a] = c[a] || function() { + (c[a].q = c[a].q || []).push(arguments); + }; + t = l.createElement(r); + t.async = 1; + t.src = "https://www.clarity.ms/tag/" + i; + y = l.getElementsByTagName(r)[0]; + if (y && y.parentNode) { + y.parentNode.insertBefore(t, y); + } else { + l.head.appendChild(t); + } })(window, document, "clarity", "script", "${CLARITY_ID}"); ` }} @@ -204,8 +214,24 @@ const ExternalPlugin = props => { async dangerouslySetInnerHTML={{ __html: ` - (function(i,s,o,g,r,a,m){i["DaoVoiceObject"]=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;a.charset="utf-8";m.parentNode.insertBefore(a,m)})(window,document,"script",('https:' == document.location.protocol ? 'https:' : 'http:') + "//widget.daovoice.io/widget/daf1a94b.js","daovoice") - ` + (function(i, s, o, g, r, a, m) { + i["DaoVoiceObject"] = r; + i[r] = i[r] || function() { + (i[r].q = i[r].q || []).push(arguments); + }; + i[r].l = 1 * new Date(); + a = s.createElement(o); + m = s.getElementsByTagName(o)[0]; + a.async = 1; + a.src = g; + a.charset = "utf-8"; + if (m && m.parentNode) { + m.parentNode.insertBefore(a, m); + } else { + s.head.appendChild(a); + } + })(window, document, "script", ('https:' == document.location.protocol ? 'https:' : 'http:') + "//widget.daovoice.io/widget/daf1a94b.js", "daovoice") + ` }} />