+ :
{children}
}
diff --git a/package.json b/package.json
index b6361461..c1f22df7 100644
--- a/package.json
+++ b/package.json
@@ -36,13 +36,14 @@
"next": "^12.0.5",
"notion-client": "^4.10.0",
"notion-utils": "^4.10.0",
- "react-notion-x": "^4.11.0",
"preact": "^10.5.15",
+ "qrcode.react": "^1.0.1",
"react": "17.0.2",
"react-cookies": "^0.1.1",
"react-cusdis": "^2.0.1",
"react-dom": "17.0.2",
- "qrcode.react": "^1.0.1",
+ "react-notion-x": "^4.11.0",
+ "smoothscroll-polyfill": "^0.4.4",
"use-ackee": "^3.0.0"
},
"devDependencies": {
diff --git a/pages/_app.js b/pages/_app.js
index 25dd8726..90a85d33 100644
--- a/pages/_app.js
+++ b/pages/_app.js
@@ -7,7 +7,6 @@ import 'katex/dist/katex.min.css'
import BLOG from 'blog.config'
import dynamic from 'next/dynamic'
import { GlobalContextProvider } from '@/lib/global'
-// 解决React-FontAwesome图标问题
import { config } from '@fortawesome/fontawesome-svg-core'
import '@fortawesome/fontawesome-svg-core/styles.css'
config.autoAddCss = false
diff --git a/pages/archive/index.js b/pages/archive/index.js
index 90ac4279..ee8f4879 100644
--- a/pages/archive/index.js
+++ b/pages/archive/index.js
@@ -3,7 +3,7 @@ import BLOG from '@/blog.config'
import BaseLayout from '@/layouts/BaseLayout'
import { getNotionPageData } from '@/lib/notion/getNotionData'
import StickyBar from '@/components/StickyBar'
-import React from 'react'
+import React, { useEffect } from 'react'
import { useGlobal } from '@/lib/global'
import BlogPostArchive from '@/components/BlogPostArchive'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
@@ -55,6 +55,22 @@ const Index = ({ allPosts, tags, categories }) => {
}
})
+ useEffect(
+ () => {
+ if (window) {
+ const anchor = window.location.hash
+ console.log('滚动', anchor)
+ if (anchor) {
+ setTimeout(() => {
+ const anchorElement = document.getElementById(anchor.substring(1))
+ if (anchorElement) { anchorElement.scrollIntoView({ block: 'start', behavior: 'smooth' }) }
+ }, 300)
+ }
+ }
+ },
+ []
+ )
+
return (
diff --git a/pages/article/[slug].js b/pages/article/[slug].js
index e8b9d59f..86462dc8 100644
--- a/pages/article/[slug].js
+++ b/pages/article/[slug].js
@@ -30,10 +30,7 @@ const Slug = ({ post, blockMap, tags, prev, next, allPosts, recommendPosts, cate
}
export async function getStaticPaths () {
- const posts = []
- // if (BLOG.isProd) {
- // posts = await getAllPosts({ from: 'slug - paths', includePage: true })
- // }
+ const posts = await getAllPosts({ from: 'slug - paths', includePage: true })
return {
paths: posts.map(row => `${BLOG.path}/article/${row.slug}`),
fallback: true
diff --git a/public/sitemap.xml b/public/sitemap.xml
index 387cdfc1..cca7c276 100644
--- a/public/sitemap.xml
+++ b/public/sitemap.xml
@@ -1,71 +1,10 @@
-https://tangly1024.comdaily0.72021-12-15T04:35:15.501Z
-https://tangly1024.com/archivedaily0.72021-12-15T04:35:15.501Z
-https://tangly1024.com/categorydaily0.72021-12-15T04:35:15.501Z
-https://tangly1024.com/feeddaily0.72021-12-15T04:35:15.501Z
-https://tangly1024.com/searchdaily0.72021-12-15T04:35:15.501Z
-https://tangly1024.com/tagdaily0.72021-12-15T04:35:15.501Z
-https://tangly1024.com/article/notion-nextdaily0.72021-12-15T04:35:15.501Z
-https://tangly1024.com/article/nextjs-notion-starter-kitdaily0.72021-12-15T04:35:15.501Z
-https://tangly1024.com/article/notion-nobelium-verceldaily0.72021-12-15T04:35:15.501Z
-https://tangly1024.com/article/fruition-notiondaily0.72021-12-15T04:35:15.501Z
-https://tangly1024.com/article/verceldaily0.72021-12-15T04:35:15.501Z
-https://tangly1024.com/article/nextjs-react-fontawesome-big-icondaily0.72021-12-15T04:35:15.501Z
-https://tangly1024.com/article/vercel-free-serverless-apidaily0.72021-12-15T04:35:15.501Z
-https://tangly1024.com/article/pay-cuts-for-civil-servantsdaily0.72021-12-15T04:35:15.501Z
-https://tangly1024.com/article/notion-short-keydaily0.72021-12-15T04:35:15.501Z
-https://tangly1024.com/article/notiondaily0.72021-12-15T04:35:15.501Z
-https://tangly1024.com/article/mac-big-sur-cvsdaily0.72021-12-15T04:35:15.501Z
-https://tangly1024.com/article/start-a-businessdaily0.72021-12-15T04:35:15.501Z
-https://tangly1024.com/article/a-routine-for-programmerdaily0.72021-12-15T04:35:15.501Z
-https://tangly1024.com/article/visual-studio-code-format-es-lintdaily0.72021-12-15T04:35:15.501Z
-https://tangly1024.com/article/window-clean-cdaily0.72021-12-15T04:35:15.501Z
-https://tangly1024.com/article/parallels-desktop16-macos-update-big-surdaily0.72021-12-15T04:35:15.501Z
-https://tangly1024.com/article/guide-of-investmentdaily0.72021-12-15T04:35:15.501Z
-https://tangly1024.com/article/nextjs-cookie-localStorage-darkModedaily0.72021-12-15T04:35:15.501Z
-https://tangly1024.com/article/about-tailwindcssdaily0.72021-12-15T04:35:15.501Z
-https://tangly1024.com/article/what-is-mvpdaily0.72021-12-15T04:35:15.501Z
-https://tangly1024.com/article/tell-a-storydaily0.72021-12-15T04:35:15.501Z
-https://tangly1024.com/article/who-is-the-ghostdaily0.72021-12-15T04:35:15.501Z
-https://tangly1024.com/article/text-affects-mooddaily0.72021-12-15T04:35:15.501Z
-https://tangly1024.com/article/start-to-writedaily0.72021-12-15T04:35:15.501Z
-https://tangly1024.com/article/the-skill-of-article-titledaily0.72021-12-15T04:35:15.501Z
-https://tangly1024.com/article/how-to-readdaily0.72021-12-15T04:35:15.501Z
-https://tangly1024.com/article/ishot-screenshotdaily0.72021-12-15T04:35:15.501Z
-https://tangly1024.com/article/compressive-abilitydaily0.72021-12-15T04:35:15.501Z
-https://tangly1024.com/article/learning-python-installdaily0.72021-12-15T04:35:15.501Z
-https://tangly1024.com/article/learning-python-web-crawlerdaily0.72021-12-15T04:35:15.501Z
-https://tangly1024.com/article/learning-python-text-to-imagedaily0.72021-12-15T04:35:15.501Z
-https://tangly1024.com/article/learning-python-video-to-textdaily0.72021-12-15T04:35:15.501Z
-https://tangly1024.com/article/nodejs-debugdaily0.72021-12-15T04:35:15.501Z
-https://tangly1024.com/article/spread-blog-by-seodaily0.72021-12-15T04:35:15.501Z
-https://tangly1024.com/article/activation-codedaily0.72021-12-15T04:35:15.501Z
-https://tangly1024.com/article/breakfastdaily0.72021-12-15T04:35:15.502Z
-https://tangly1024.com/article/improve-the-physiquedaily0.72021-12-15T04:35:15.502Z
-https://tangly1024.com/article/charlie-thomas-mungerdaily0.72021-12-15T04:35:15.502Z
-https://tangly1024.com/article/welcome-to-fuzhoudaily0.72021-12-15T04:35:15.502Z
-https://tangly1024.com/article/PhD-thiefdaily0.72021-12-15T04:35:15.502Z
-https://tangly1024.com/article/fart-hitlerdaily0.72021-12-15T04:35:15.502Z
-https://tangly1024.com/article/why-to-writedaily0.72021-12-15T04:35:15.502Z
-https://tangly1024.com/article/start-to-praisedaily0.72021-12-15T04:35:15.502Z
-https://tangly1024.com/article/compare-build-happinessdaily0.72021-12-15T04:35:15.502Z
-https://tangly1024.com/article/git-ssl-errordaily0.72021-12-15T04:35:15.502Z
-https://tangly1024.com/article/chronic-gastritisdaily0.72021-12-15T04:35:15.502Z
-https://tangly1024.com/article/position-managementdaily0.72021-12-15T04:35:15.502Z
-https://tangly1024.com/article/attempt-of-make-moneydaily0.72021-12-15T04:35:15.502Z
-https://tangly1024.com/article/aboutdaily0.72021-12-15T04:35:15.502Z
-https://tangly1024.com/article/watermelon-salerdaily0.72021-12-15T04:35:15.502Z
-https://tangly1024.com/article/hao-huan-luodaily0.72021-12-15T04:35:15.502Z
-https://tangly1024.com/article/playgrounddaily0.72021-12-15T04:35:15.502Z
-https://tangly1024.com/article/the-psychology-of-human-misjudgementdaily0.72021-12-15T04:35:15.502Z
-https://tangly1024.com/article/privacy-policydaily0.72021-12-15T04:35:15.502Z
-https://tangly1024.com/article/hexo-install-butterflydaily0.72021-12-15T04:35:15.502Z
-https://tangly1024.com/article/hexo-install-indigodaily0.72021-12-15T04:35:15.502Z
-https://tangly1024.com/article/flow-pooldaily0.72021-12-15T04:35:15.502Z
-https://tangly1024.com/article/detail-marketingdaily0.72021-12-15T04:35:15.502Z
-https://tangly1024.com/article/mac-os-printer-full-paperdaily0.72021-12-15T04:35:15.502Z
-https://tangly1024.com/article/poor-economicsdaily0.72021-12-15T04:35:15.502Z
-https://tangly1024.com/article/meta-universe-scamdaily0.72021-12-15T04:35:15.502Z
-https://tangly1024.com/article/thinking-fast-and-slowdaily0.72021-12-15T04:35:15.502Z
+https://tangly1024.comdaily0.72021-12-16T03:34:52.290Z
+https://tangly1024.com/aboutdaily0.72021-12-16T03:34:52.290Z
+https://tangly1024.com/archivedaily0.72021-12-16T03:34:52.290Z
+https://tangly1024.com/categorydaily0.72021-12-16T03:34:52.290Z
+https://tangly1024.com/feeddaily0.72021-12-16T03:34:52.290Z
+https://tangly1024.com/searchdaily0.72021-12-16T03:34:52.290Z
+https://tangly1024.com/tagdaily0.72021-12-16T03:34:52.290Z
\ No newline at end of file