From 383f3dc0891ccbc9a125ad6e16dfb2ea8209c69c Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Mon, 27 Sep 2021 14:57:31 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9B=A0=20SideBar=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- blog.config.js | 7 ++- components/DarkModeButton.js | 6 +- components/Footer.js | 6 +- components/Header.js | 25 ++++++++- components/LeftAside.js | 70 ----------------------- components/SideBar.js | 75 +++++++++++++++++++++++++ components/ThirdPartyScript.js | 79 ++++++++++++++++++++++++++ components/TopNav.js | 18 ++---- layouts/ArticleLayout.js | 4 +- layouts/DefaultLayout.js | 18 +++--- pages/_document.js | 100 ++------------------------------- styles/globals.css | 14 +++-- 12 files changed, 215 insertions(+), 207 deletions(-) delete mode 100644 components/LeftAside.js create mode 100644 components/SideBar.js create mode 100644 components/ThirdPartyScript.js diff --git a/blog.config.js b/blog.config.js index 4cd6807c..a2cfbf54 100644 --- a/blog.config.js +++ b/blog.config.js @@ -32,7 +32,9 @@ const BLOG = { }, gaConfig: { measurementId: 'G-5EV4HZD0XX' // e.g: G-XXXXXXXXXX - } + }, + baidyAnalytics: 'f683ef76f06bb187cbed5546f6f28f28', // e.g only need xxxxx -> https://hm.baidu.com/hm.js?xxxxx + busuanzi: true // see http://busuanzi.ibruce.info/ }, comment: { // support provider: gitalk, utterances, cusdis @@ -54,7 +56,8 @@ const BLOG = { repo: 'tangly1024/NotionNext' } }, - 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', // distinguish between development and production environment (ref: https://vercel.com/docs/environment-variables#system-environment-variables) + googleAdsense: true } // export default BLOG module.exports = BLOG diff --git a/components/DarkModeButton.js b/components/DarkModeButton.js index 889c8b88..3e330299 100644 --- a/components/DarkModeButton.js +++ b/components/DarkModeButton.js @@ -8,12 +8,10 @@ const DarkModeButton = () => { changeTheme(newTheme) localStorage.setItem('theme', newTheme) } - return
-
-
} export default DarkModeButton diff --git a/components/Footer.js b/components/Footer.js index 35ae7c86..c098a753 100644 --- a/components/Footer.js +++ b/components/Footer.js @@ -7,8 +7,8 @@ const Footer = ({ fullWidth = true }) => { const y = d.getFullYear() const from = +BLOG.since return ( -
@@ -16,7 +16,7 @@ const Footer = ({ fullWidth = true }) => {
{from === y || !from ? y : `${from} - ${y}`} {BLOG.author}
-
+ ) } diff --git a/components/Header.js b/components/Header.js index 768086ee..328ea275 100644 --- a/components/Header.js +++ b/components/Header.js @@ -49,6 +49,27 @@ const Header = ({ navBarTitle, fullWidth }) => { }, [sentinelRef]) return ( <> + { BLOG.autoCollapsedNavBar === true && ( + - )} - - {/* 统计脚本 */} - {BLOG.isProd && BLOG.analytics && BLOG.analytics.provider === 'ackee' && ( -