Skip to content

Commit

Permalink
Merge pull request #1224 from tangly1024/feat/restore-scroll-
Browse files Browse the repository at this point in the history
feat 保留滚动进度
  • Loading branch information
tangly1024 authored Jun 30, 2023
2 parents 8c76b30 + 008ac7e commit 96908a9
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .env.local
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# 环境变量 @see https://www.nextjs.cn/docs/basic-features/environment-variables
NEXT_PUBLIC_VERSION=3.16.2
NEXT_PUBLIC_VERSION=3.16.3
2 changes: 1 addition & 1 deletion blog.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const BLOG = {
process.env.NOTION_PAGE_ID || '02ab3b8678004aa69e9e415905ef32a5',
PSEUDO_STATIC: false, // 伪静态路径,开启后所有文章URL都以 .html 结尾。
NEXT_REVALIDATE_SECOND: process.env.NEXT_PUBLIC_REVALIDATE_SECOND || 5, // 更新内容缓存间隔 单位(秒);即每个页面有5秒的纯静态期、此期间无论多少次访问都不会抓取notion数据;调大该值有助于节省Vercel资源、同时提升访问速率,但也会使文章更新有延迟。
THEME: process.env.NEXT_PUBLIC_THEME || 'fukasawa', // 主题, 支持 ['next','hexo',"fukasawa','medium','example','matery','gitbook','simple'] @see https://preview.tangly1024.com
THEME: process.env.NEXT_PUBLIC_THEME || 'hexo', // 主题, 支持 ['next','hexo',"fukasawa','medium','example','matery','gitbook','simple'] @see https://preview.tangly1024.com
THEME_SWITCH: process.env.NEXT_PUBLIC_THEME_SWITCH || false, // 是否显示切换主题按钮
LANG: process.env.NEXT_PUBLIC_LANG || 'zh-CN', // e.g 'zh-CN','en-US' see /lib/lang.js for more.
SINCE: 2021, // e.g if leave this empty, current year will be used.
Expand Down
3 changes: 3 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,8 @@ module.exports = withBundleAnalyzer({
config.resolve.alias['@theme-components'] = path.resolve(__dirname, 'themes', THEME)

return config
},
experimental: {
scrollRestoration: true
}
})
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "notion-next",
"version": "3.16.2",
"version": "3.16.3",
"homepage": "https://github.com/tangly1024/NotionNext.git",
"license": "MIT",
"repository": {
Expand Down
3 changes: 0 additions & 3 deletions pages/[...slug].js
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ const Slug = props => {
post.toc = getPageTableOfContents(post, post.blockMap)
}
}
router.events.on('routeChangeComplete', () => {
window.scrollTo({ top: 0, behavior: 'smooth' })
})
}, [post])

const meta = {
Expand Down

0 comments on commit 96908a9

Please sign in to comment.