Skip to content

Commit

Permalink
Merge branch 'tangly1024:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
denda188 authored Sep 6, 2024
2 parents e3a149c + c2c8501 commit d524821
Show file tree
Hide file tree
Showing 66 changed files with 1,566 additions and 1,032 deletions.
2 changes: 1 addition & 1 deletion .env.local
Original file line number Diff line number Diff line change
@@ -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


# 可在此添加环境变量,去掉最左边的(# )注释即可
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/docker-ghcr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pushUrl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ yarn-error.log*
/public/robots.txt
/public/sitemap.xml
/public/rss/*

/sitemap.xml

# yarn
package-lock.json
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
24 changes: 10 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# 帮助教程

访问帮助:[NotionNext帮助手册](https://docs.tangly1024.com/)

> 本项目教程为免费、公开资源,仅限个人学习使用。严禁任何个人或组织将本教程用于商业用途,包括但不限于直接售卖、间接收费、或其他变相盈利行为。转载、复制或介绍本教程内容时,须保留作者信息并明确注明来源。
> 本项目仅提供由作者团队授权的付费咨询服务,请注意辨别,谨防诈骗行为。任何未经授权的收费服务均可能存在法律风险。
Notion是一个能让效率暴涨的生产力引擎,可以帮你书写文档、管理笔记,搭建知识库,甚至可以为你规划项目、时间管理、组织团队、提高生产力、还有当前最强大的AI技术加持。
> 如果希望进一步探索Notion的功能,欢迎购买《[Notion笔记从入门到精通进阶课程](https://docs.tangly1024.com/article/notion-tutorial)
# NotionNext

<p>
Expand Down Expand Up @@ -31,20 +41,6 @@
|--|--|--|--|
| <img src='./docs/theme-next.png' width='300'/> [预览NEXT](https://preview.tangly1024.com/?theme=next) | <img src='./docs/theme-medium.png' width='300'/> [预览MEDIUM](https://preview.tangly1024.com/?theme=medium) | <img src='./docs/theme-hexo.png' width='300'/> [预览HEXO](https://preview.tangly1024.com/?theme=hexo) | <img src='./docs/theme-fukasawa.png' width='300'/> [预览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项目

Expand Down
26 changes: 12 additions & 14 deletions README_EN.md
Original file line number Diff line number Diff line change
@@ -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

<p>
Expand Down Expand Up @@ -31,20 +43,6 @@ Live Demo:[https://preview.tangly1024.com/](https://preview.tangly1024.com/)
|--|--|--|--|
| <img src='./docs/theme-next.png' width='300'/> [NEXT](https://preview.tangly1024.com/?theme=next) | <img src='./docs/theme-medium.png' width='300'/> [MEDIUM](https://preview.tangly1024.com/?theme=medium) | <img src='./docs/theme-hexo.png' width='300'/> [HEXO](https://preview.tangly1024.com/?theme=hexo) | <img src='./docs/theme-fukasawa.png' width='300'/> [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.
Expand Down
2 changes: 1 addition & 1 deletion blog.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,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 // 版本号
}
Expand Down
18 changes: 9 additions & 9 deletions components/Ackee.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
)
Expand Down
14 changes: 8 additions & 6 deletions components/CustomContextMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand Down
4 changes: 3 additions & 1 deletion components/DifyChatbot.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
};
}, []); // 注意依赖数组为空,意味着脚本将仅在加载页面时执行一次

Expand Down
40 changes: 33 additions & 7 deletions components/ExternalPlugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -145,7 +146,7 @@ const ExternalPlugin = props => {
{AD_WWADS_BLOCK_DETECT && <AdBlockDetect />}
{TIANLI_KEY && <TianLiGPT />}
<VConsole />
<LoadingProgress />
{ENABLE_NPROGRSS && <LoadingProgress />}
<AosAnimation />
{ANALYTICS_51LA_ID && ANALYTICS_51LA_CK && <LA51 />}

Expand Down Expand Up @@ -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}");
`
}}
Expand All @@ -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")
`
}}
/>
<script
Expand Down
6 changes: 5 additions & 1 deletion components/FacebookMessenger.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,11 @@ class MessengerCustomerChat extends Component {
js = d.createElement(s);
js.id = id;
js.src = `https://connect.facebook.net/${language}/sdk/xfbml.customerchat.js`;
fjs.parentNode.insertBefore(js, fjs);
if (fjs && fjs.parentNode && fjs.parentNode.contains(fjs)) {
fjs.parentNode.insertBefore(js, fjs);
} else {
document.body.appendChild(js);
}
})(document, 'script', 'facebook-jssdk');
/* eslint-enable */
}
Expand Down
2 changes: 1 addition & 1 deletion components/Fireworks.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const Fireworks = () => {
// 异步加载
async function loadFireworks() {
loadExternalResource(
'https://cdn.bootcdn.net/ajax/libs/animejs/3.2.1/anime.min.js',
'https://cdnjs.snrat.com/ajax/libs/animejs/3.2.1/anime.min.js',
'js'
).then(() => {
loadExternalResource('/js/fireworks.js', 'js').then(() => {
Expand Down
71 changes: 71 additions & 0 deletions components/LoadingCover.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import { useGlobal } from '@/lib/global'
import { useEffect, useState } from 'react'
/**
* @see https://css-loaders.com/
* @returns 加载动画
*/
export default function LoadingCover() {
const { onLoading, setOnLoading } = useGlobal()
const [isVisible, setIsVisible] = useState(false) // 初始状态设置为false,避免服务端渲染与客户端渲染不一致

useEffect(() => {
// 确保在客户端渲染时才设置可见性
if (onLoading) {
setIsVisible(true)
} else {
const timeout = setTimeout(() => setIsVisible(false), 1500) // 等待淡出动画结束
return () => clearTimeout(timeout)
}
}, [onLoading])

const handleClick = () => {
setOnLoading(false) // 强行关闭 LoadingCover
}

if (typeof window === 'undefined') {
return null // 避免在服务端渲染时渲染出这个组件
}

return isVisible ? (
<div
id='loading-cover'
onClick={handleClick}
className={`dark:text-white text-black bg-white dark:bg-black animate__animated animate__faster ${
onLoading ? 'animate__fadeIn' : 'animate__fadeOut'
} flex flex-col justify-center z-50 w-full h-screen fixed top-0 left-0`}>
<div className='mx-auto'>
<style global>
{`
.loader {
width: 20px;
aspect-ratio: 1;
border-radius: 50%;
background: #000;
box-shadow: 0 0 0 0 #0004;
animation: l2 1.5s infinite linear;
position: relative;
}
.loader:before,
.loader:after {
content: '';
position: absolute;
inset: 0;
border-radius: inherit;
box-shadow: 0 0 0 0 #0004;
animation: inherit;
animation-delay: -0.5s;
}
.loader:after {
animation-delay: -1s;
}
@keyframes l2 {
100% {
box-shadow: 0 0 0 40px #0000;
}
}`}
</style>
<div className='loader'></div>
</div>
</div>
) : null
}
Loading

0 comments on commit d524821

Please sign in to comment.