Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
e161823
fix: 🐛 修復 Hexo 主題下 404 頁面無法在地化
noeFly Feb 11, 2025
8df49a1
fix: 🐛 修復 i18n 無法套用語言變體
noeFly Feb 12, 2025
861b8a9
refactor: 🚨 Prettier 自動格式化
noeFly Feb 12, 2025
0031a46
Merge branch 'main' into fix/hexo_404
noeFly Feb 23, 2025
76aa385
Merge branch 'main' into fix/local
noeFly Feb 23, 2025
86b59b6
fix(sitemap多了个斜杠导致Google Search Console无法自动编入索引)
LooseLi Mar 20, 2025
379d0db
fix(自定义备案链接不生效)
LooseLi Mar 20, 2025
5bb49ae
fix: search bar function
rickyltwong Mar 23, 2025
4d988fb
feat: Added Threads Social and Share buttons
rickyltwong Mar 23, 2025
a3ea5c0
fix(子菜单闪烁问题)
LooseLi Mar 24, 2025
d81d6e7
fix(子菜单闪烁问题)
LooseLi Mar 24, 2025
2ac4f9f
fix(hexo主题子菜单闪烁问题)
LooseLi Mar 24, 2025
72e6395
fix(优化子菜单闪烁代码)
LooseLi Mar 24, 2025
950c3ca
fix(子菜单闪烁问题)
LooseLi Mar 24, 2025
58f6eed
feat(contributors)
LooseLi Mar 26, 2025
8e0dd0b
fix(文章排序)
LooseLi Mar 31, 2025
276a0ae
build(tsconfig): update tsconfig to exclude the public directory
qixing-jk Apr 1, 2025
86a1edd
fix: enable all Notion file types to work properly
LooseLi Apr 7, 2025
1d707e0
Update README.md
tangly1024 Apr 11, 2025
a494b94
fix ribbon彩条bug
tangly1024 Apr 11, 2025
b1ea264
Iconfont
tangly1024 Apr 11, 2025
33ed18d
gtag fix
tangly1024 Apr 11, 2025
53a25e1
Merge branch 'main' into feat-iconfont
tangly1024 Apr 11, 2025
24aed94
Merge pull request #3324 from tangly1024/feat-iconfont
tangly1024 Apr 11, 2025
d9e215b
Merge pull request #3317 from LooseLi/fix-fileUrl
tangly1024 Apr 11, 2025
ef65558
Merge pull request #3310 from LooseLi/post-sort-by
tangly1024 Apr 11, 2025
ecc1e79
Merge pull request #3312 from qixing-jk/build/tsconfig
tangly1024 Apr 11, 2025
ea50583
Merge pull request #3301 from LooseLi/contributors
tangly1024 Apr 11, 2025
5ab6e0c
Merge pull request #3299 from LooseLi/menu-item-drop
tangly1024 Apr 11, 2025
a131acf
Merge pull request #3298 from rickyltwong/feat/threads-button
tangly1024 Apr 11, 2025
5053528
Merge pull request #3297 from rickyltwong/fix/simple-theme-search-bar
tangly1024 Apr 11, 2025
3f8fbf3
Merge pull request #3287 from LooseLi/dev
tangly1024 Apr 11, 2025
99ba183
fix lang
tangly1024 Apr 11, 2025
f16b7b7
Merge branch 'main' into pr/noeFly/3223
tangly1024 Apr 11, 2025
4ee9656
fix(修复隐藏文章中无法显示只存在于隐藏文章中的标签的问题):
qixing-jk Apr 11, 2025
37b6c5b
fix iconfont not found
tangly1024 Apr 11, 2025
d94cc33
Merge branch 'main' into fix/hexo_404
tangly1024 Apr 11, 2025
f3278fa
Merge pull request #3222 from noeFly/fix/hexo_404
tangly1024 Apr 11, 2025
c5c88a0
Merge pull request #3326 from tangly1024/fix/iconfont
tangly1024 Apr 11, 2025
7dbbcdd
Merge pull request #3325 from qixing-jk/fix/invisible-tag
tangly1024 Apr 11, 2025
56fe78e
版本号4.8.4
tangly1024 Apr 11, 2025
3887845
Merge pull request #3327 from tangly1024/release/4.8.4
tangly1024 Apr 11, 2025
ab1fbe1
fix(修复tags为空时foreach报错的问题)
qixing-jk Apr 11, 2025
85ca8b1
修復无标签编译出错
tangly1024 Apr 12, 2025
953a09b
Merge pull request #3331 from tangly1024/release/4.8.4
tangly1024 Apr 12, 2025
951c4ea
theme-proxio-init
tangly1024 Apr 12, 2025
9087270
Merge branch 'main' into feat/theme-proxio
tangly1024 Apr 12, 2025
9e68ec7
iconfont 日志清理
tangly1024 Apr 12, 2025
31d0f6d
lenis 滚动质感
tangly1024 Apr 12, 2025
d43d1bc
Lenis
tangly1024 Apr 12, 2025
2d3a3ac
proxio主题加入部分动画
tangly1024 Apr 12, 2025
610550e
Blog Card 样式微调
tangly1024 Apr 12, 2025
4bdde35
proxio 初版
tangly1024 Apr 13, 2025
8e5f1ba
proxio 主題微調
tangly1024 Apr 13, 2025
9234fbb
fix
tangly1024 Apr 13, 2025
f821447
Merge pull request #3338 from tangly1024/feat/theme-proxio
tangly1024 Apr 13, 2025
d445ac8
proxio细节图片调整
tangly1024 Apr 13, 2025
7446a7a
lazyimage 优化
tangly1024 Apr 13, 2025
8d00418
Merge pull request #3339 from tangly1024/feat/theme-proxio
tangly1024 Apr 13, 2025
ba9f24d
proxio 切换主题时的背景色
tangly1024 Apr 13, 2025
52e2771
Merge pull request #3340 from tangly1024/feat/theme-proxio
tangly1024 Apr 13, 2025
1527c5c
proxio 微调
tangly1024 Apr 13, 2025
ef91778
Merge pull request #3341 from tangly1024/feat/theme-proxio
tangly1024 Apr 13, 2025
24d9d1c
微调白点
tangly1024 Apr 13, 2025
091a7e5
Merge pull request #3342 from tangly1024/feat/theme-proxio
tangly1024 Apr 13, 2025
dacf1a2
proxio 白点动画相关
tangly1024 Apr 14, 2025
6f770a5
Merge pull request #3349 from tangly1024/feat/theme-proxio
tangly1024 Apr 14, 2025
f6c2ccf
fix: correct RightFloatArea hiding behavior when scrolling back to top
LooseLi Apr 15, 2025
1363cb5
style: 格式化代码
LooseLi Apr 16, 2025
b9738d2
Merge pull request #3355 from LooseLi/fix-hexo-right-float-area
tangly1024 Apr 16, 2025
10d5641
Merge branch 'main' into fix/invisible-tag
tangly1024 Apr 16, 2025
41c6855
Merge pull request #3329 from qixing-jk/fix/invisible-tag
tangly1024 Apr 16, 2025
17826af
Merge branch 'deploy' of https://github.com/RS-Imagine/NotionNext
RS-Imagine Apr 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 6 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ here is the website->[ImagineBlog](https://forimagine.eu.org 'ImagineBlog')

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

> 本项目教程为免费、公开资源,仅限个人学习使用。严禁任何个人或组织将本教程用于商业用途,包括但不限于直接售卖、间接收费、或其他变相盈利行为。转载、复制或介绍本教程内容时,须保留作者信息并明确注明来源。
> 本项目教程为免费、公开资源,仅限个人学习使用,禁止利用本教程建立的博客发布非法内容、进行违法犯罪活动。严禁任何个人或组织将本教程用于商业用途,包括但不限于直接售卖、间接收费、或其他变相盈利行为。转载、复制或介绍本教程内容时,须保留作者信息并明确注明来源。
> 本项目仅提供由作者团队授权的付费咨询服务,请注意辨别,谨防诈骗行为。任何未经授权的收费服务均可能存在法律风险。

Notion是一个能让效率暴涨的生产力引擎,可以帮你书写文档、管理笔记,搭建知识库,甚至可以为你规划项目、时间管理、组织团队、提高生产力、还有当前最强大的AI技术加持。
Expand Down Expand Up @@ -63,20 +63,11 @@ A static blog system built with NextJS and Notion API, deployed on Vercel. Desig

## Contributors

<table>
<tr align="left">
<td align="center">
<a href="https://github.com/tangly1024" style="display:inline-block;width:80px"><img src="https://avatars.githubusercontent.com/u/15920488" width="64px;"alt="tangly1024"/><br/><sub><b>tangly1024</b></sub></a><br/><a href="https://github.com/tangly1024/NotionNext/commits?author=tangly1024" title="Owner" >🎫 🔧 🐛</a>
</td>

<td align="center">
<a href="https://github.com/uWayLu" style="display:inline-block;width:80px"><img src="https://avatars.githubusercontent.com/u/21689326" width="64px;" alt="uWayLu"/><br/><sub><b>uWayLu</b></sub></a><br/><a href="https://github.com/tangly1024/NotionNext/commits?author=uWayLu" title="uWayLu" >🔧 🐛</a>
</td>

<td align="center">
<a href="https://github.com/txs" style="display:inline-block;width:80px"><img src="https://avatars.githubusercontent.com/u/554329" width="64px;" alt="txs"/><br/><sub><b>txs</b></sub></a><br/><a href="https://github.com/tangly1024/NotionNext/commits?author=txs" title="txs" >🔧 🐛</a>
</td>
感谢所有为 NotionNext 做出贡献的人!

<<<<<<< HEAD
[![Contributors](https://contrib.rocks/image?repo=tangly1024/NotionNext)](https://github.com/tangly1024/NotionNext/graphs/contributors)
=======
<td align="center">
<a href="https://github.com/yuzhanglong" style="display:inline-block;width:80px"><img src="https://avatars.githubusercontent.com/u/56540811" width="64px;" alt="yuzhanglong"/><br/><sub><b>yuzhanglong</b></sub></a><br/><a href="https://github.com/tangly1024/NotionNext/commits?author=yuzhanglong" title="yuzhanglong" >🔧 🐛</a>
</td>
Expand Down Expand Up @@ -179,6 +170,7 @@ A static blog system built with NextJS and Notion API, deployed on Vercel. Desig

</tr>
</table>
>>>>>>> d371156ad7ec1c8348365a5c983b2e04780a8180


## 引用技术
Expand Down
5 changes: 5 additions & 0 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ You can set up your personal website in just a few minutes. Here is the link to

## 贡献者

<<<<<<< HEAD:README_EN.md
This project exists thanks to all the people who contribute.
=======
<table>
<tr align="left">
<td align="center">
Expand Down Expand Up @@ -188,7 +191,9 @@ You can set up your personal website in just a few minutes. Here is the link to

</tr>
</table>
>>>>>>> d371156ad7ec1c8348365a5c983b2e04780a8180:README_CN.md

[![Contributors](https://contrib.rocks/image?repo=tangly1024/NotionNext)](https://github.com/tangly1024/NotionNext/graphs/contributors)

## 引用技术

Expand Down
107 changes: 107 additions & 0 deletions components/CursorDot.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
import { useRouter } from 'next/router';
import { useEffect } from 'react';
/**
* 白点鼠标跟随
* @returns
*/
const CursorDot = () => {
const router = useRouter();
useEffect(() => {
// 创建小白点元素
const dot = document.createElement('div');
dot.classList.add('cursor-dot');
document.body.appendChild(dot);

// 鼠标坐标和缓动目标坐标
let mouse = { x: -100, y: -100 }; // 初始位置在屏幕外
let dotPos = { x: mouse.x, y: mouse.y };

// 监听鼠标移动
const handleMouseMove = (e) => {
mouse.x = e.clientX;
mouse.y = e.clientY;
};
document.addEventListener('mousemove', handleMouseMove);

// 监听鼠标悬停在可点击对象上的事件
const handleMouseEnter = () => {
dot.classList.add('cursor-dot-hover'); // 添加放大样式
};
const handleMouseLeave = () => {
dot.classList.remove('cursor-dot-hover'); // 移除放大样式
};


// 为所有可点击元素和包含 hover 或 group-hover 类名的元素添加事件监听
setTimeout(() => {
const clickableElements = document.querySelectorAll(
'a, button, [role="button"], [onclick], [cursor="pointer"], [class*="hover"], [class*="group-hover"], [class*="cursor-pointer"]'
);
clickableElements.forEach((el) => {
el.addEventListener('mouseenter', handleMouseEnter);
el.addEventListener('mouseleave', handleMouseLeave);
});
}, 200); // 延时 200ms 执行

// 动画循环:延迟更新小白点位置
const updateDotPosition = () => {
const damping = 0.2; // 阻尼系数,值越小延迟越明显
dotPos.x += (mouse.x - dotPos.x) * damping;
dotPos.y += (mouse.y - dotPos.y) * damping;

// 更新DOM
dot.style.left = `${dotPos.x}px`;
dot.style.top = `${dotPos.y}px`;

requestAnimationFrame(updateDotPosition);
};

// 启动动画
updateDotPosition();

// 清理函数
return () => {
document.removeEventListener('mousemove', handleMouseMove);
const clickableElements = document.querySelectorAll(
'a, button, [role="button"], [onclick], [cursor="pointer"], [class*="hover"], [class*="group-hover"], [class*="cursor-pointer"]'
);
clickableElements.forEach((el) => {
el.removeEventListener('mouseenter', handleMouseEnter);
el.removeEventListener('mouseleave', handleMouseLeave);
});
document.body.removeChild(dot);
};
}, [router]);

return (
<style jsx global>{`
.cursor-dot {
position: fixed;
width: 12px;
height: 12px;
background: white;
border-radius: 50%;
pointer-events: none;
transform: translate(-50%, -50%);
z-index: 9999;
transition: transform 100ms ease-out, width 200ms ease, height 200ms ease; /* 添加尺寸平滑过渡 */
mix-blend-mode: difference; /* 可选:增强对比度 */
}

.cursor-dot-hover {
border: 1px solid rgba(167, 167, 167, 0.14); /* 鼠标悬停时的深灰色边框,厚度为1px */
width: 60px; /* 放大 */
height: 60px; /* 放大 */
background: hsla(0, 0%, 100%, 0.04); /* 半透明背景 */
-webkit-backdrop-filter: blur(5px); /* 毛玻璃效果 */
backdrop-filter: blur(5px);
}

.dark .cursor-dot-hover {
border: 1px solid rgba(66, 66, 66, 0.66); /* 鼠标悬停时的深灰色边框,厚度为1px */
}
`}</style>
);
};

export default CursorDot;
11 changes: 9 additions & 2 deletions components/ExternalPlugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'


/**
* 各种插件脚本
Expand All @@ -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)
Expand Down Expand Up @@ -124,6 +128,8 @@ const ExternalPlugin = props => {
NOTION_CONFIG
)

const ENABLE_ICON_FONT = siteConfig('ENABLE_ICON_FONT', false)

// 自定义样式css和js引入
if (isBrowser) {
// 初始化AOS动画
Expand Down Expand Up @@ -165,8 +171,8 @@ const ExternalPlugin = props => {
}

setTimeout(() => {
// 将notion-id格式的url转成自定义slug
convertInnerUrl(props?.allNavPages)
// 映射url
convertInnerUrl({ allPages:props?.allNavPages, lang:lang })
}, 500)
}, [router])

Expand All @@ -184,6 +190,7 @@ const ExternalPlugin = props => {
<>
{/* 全局样式嵌入 */}
<GlobalStyle />
{ENABLE_ICON_FONT && <IconFont />}
{MOUSE_FOLLOW && <MouseFollow />}
{THEME_SWITCH && <ThemeSwitch />}
{DEBUG && <DebugPanel />}
Expand Down
56 changes: 56 additions & 0 deletions components/IconFont.js
Original file line number Diff line number Diff line change
@@ -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:', u);

// 查找所有 <i> 标签且 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) {
// 创建新的 <svg> 元素
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);

// 替换原来的 <i> 元素
element.replaceWith(svgElement);
// console.log(`Replaced <i> with class "${className}" to <svg>`);
}
});
})
.catch(error => {
console.warn('Failed to load iconfont.js:', error);
});
}, [router]);

return <style jsx global>
{`
.icon {
width: 1.1em;
height: 1.1em;
vertical-align: -0.15em;
fill: currentColor;
overflow: hidden;
}

svg.icon {
display: inline;
}
`}</style>
}
14 changes: 0 additions & 14 deletions components/LazyImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,20 +129,6 @@ export default function LazyImage({
<link rel='preload' as='image' href={adjustImgSize(src, maxWidth)} />
</Head>
)}
<style>
{`
.lazy-image-placeholder{
background:
linear-gradient(90deg,#0001 33%,#0005 50%,#0001 66%)
#f2f2f2;
background-size:300% 100%;
animation: l1 1s infinite linear;
}
@keyframes l1 {
0% {background-position: right}
}
`}
</style>
</>
)
}
Expand Down
69 changes: 69 additions & 0 deletions components/Lenis.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import { useEffect, useRef } from 'react'
import { loadExternalResource } from '@/lib/utils'

/**
* 滚动阻尼特效
* 目前只用在proxio主题
* @returns
*/
const Lenis = () => {
const lenisRef = useRef(null) // 用于存储 Lenis 实例

useEffect(() => {
// 异步加载
async function loadLenis() {
loadExternalResource('/js/lenis.js', 'js').then(() => {
// console.log('Lenis', window.Lenis)
if (!window.Lenis) {
console.error('Lenis not loaded')
return
}
const Lenis = window.Lenis

// 创建 Lenis 实例
const lenis = new Lenis({
duration: 1.2,
easing: (t) => Math.min(1, 1.001 - Math.pow(2, -10 * t)), // https://www.desmos.com/calculator/brs54l4xou
direction: 'vertical', // vertical, horizontal
gestureDirection: 'vertical', // vertical, horizontal, both
smooth: true,
mouseMultiplier: 1,
smoothTouch: false,
touchMultiplier: 2,
infinite: false,
})

// 存储实例到 ref
lenisRef.current = lenis

// 监听滚动事件
// lenis.on('scroll', ({ scroll, limit, velocity, direction, progress }) => {
// // console.log({ scroll, limit, velocity, direction, progress })
// })

// 动画帧循环
function raf(time) {
lenis.raf(time)
requestAnimationFrame(raf)
}

requestAnimationFrame(raf)
})
}

loadLenis()

return () => {
// 在组件卸载时清理资源
if (lenisRef.current) {
lenisRef.current.destroy() // 销毁 Lenis 实例
lenisRef.current = null
// console.log('Lenis instance destroyed')
}
}
}, [])

return <></>
}

export default Lenis
12 changes: 12 additions & 0 deletions components/ShareButtons.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ import {
TumblrShareButton,
TwitterIcon,
TwitterShareButton,
ThreadsIcon,
ThreadsShareButton,
ViberIcon,
ViberShareButton,
VKIcon,
Expand Down Expand Up @@ -312,6 +314,16 @@ const ShareButtons = ({ post }) => {
<HatenaIcon size={32} round />
</HatenaShareButton>
)
case 'threads':
return (
<ThreadsShareButton
key={singleService}
url={shareUrl}
title={titleWithSiteInfo}
className='mx-1'>
<ThreadsIcon size={32} round />
</ThreadsShareButton>
)
case 'qq':
return (
<button
Expand Down
2 changes: 1 addition & 1 deletion lib/cache/cache_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export async function getOrSetDataWithCustomCache(
) {
const dataFromCache = await getDataFromCache(key)
if (dataFromCache) {
console.log('[缓存-->>API]:', key)
// console.log('[缓存-->>API]:', key) // 避免过多的缓存日志输出
return dataFromCache
}
const data = await getDataFunction(...getDataArgs)
Expand Down
Loading