diff --git a/blog.config.js b/blog.config.js index d35bb178..80bce8f6 100644 --- a/blog.config.js +++ b/blog.config.js @@ -6,16 +6,8 @@ const BLOG = { email: 'tlyong1992@hotmail.com', // 联系邮箱 link: 'https://tangly1024.com', // 网站地址 keywords: ['Notion', '写作', '博客'], // 网站关键词 - home: { // 首页 - showHomeBanner: false, // 首页是否显示大图及标语 [true,false] - homeBannerStrings: ['Hi,我是一个程序员', 'Hi,我是一个打工人', 'Hi,我是一个干饭人', '欢迎来到我的博客🎉'], // 首页大图标语文字 - homeBannerImage: './bg_image.jpg', // 背景图地址 - showPostCover: false, // 文章列表显示封面图 - showPreview: true, // 列表展示文章预览 - previewLines: 12, // 预览文章的篇幅 - showSummary: false // 显示用户自定义摘要 - }, lang: 'zh-CN', // ['zh-CN','en-US'] default lang => see /lib/lang.js for more. + beian: '闽ICP备20010331号', // 备案号 notionPageId: process.env.NOTION_PAGE_ID || 'bee1fccfa3bd47a1a7be83cc71372d83', // Important page_id!!! notionAccessToken: process.env.NOTION_ACCESS_TOKEN || '', // Useful if you prefer not to make your database public appearance: 'auto', // ['light', 'dark', 'auto'], @@ -26,29 +18,8 @@ const BLOG = { since: 2020, // if leave this empty, current year will be used. postListStyle: 'page', // ['page','scroll] 文章列表样式:页码分页、单页滚动加载 postsPerPage: 6, // post counts per page + previewLines: 12, // 预览博客行数 sortByDate: false, - topNavType: 'normal', // ['fixed','autoCollapse','normal'] 分别是固定顶部、固定底部滑动时自动折叠,不固定 - menu: { // 菜单栏设置 - showAbout: false, // 显示关于 - showCategory: true, // 显示分类 - showTag: true, // 显示标签 - showArchive: true, // 显示归档 - showSearch: true // 显示搜索 - }, - widget: { // 挂件及组件设置 - showPet: false, // 是否显示宠物挂件 - petLink: 'https://cdn.jsdelivr.net/npm/live2d-widget-model-wanko@1.0.5/assets/wanko.model.json', // 挂件模型地址 @see https://github.com/xiazeyu/live2d-widget-models - showToTop: true, // 是否显示回顶 - showToBottom: false, // 显示回底 - showDarkMode: false, // 显示日间/夜间模式切换 - showToc: true, // 移动端显示悬浮目录 - showShareBar: false, // 文章分享功能 - showRelatePosts: true, // 相关文章推荐 - showCopyRight: true, // 文章版权声明 - showLatestPost: false, // 右侧边栏显示最近更新 - showCategoryList: false, // 右侧边栏显示文章分类列表 - showTagList: false // 右侧边栏显示标签分类列表 - }, socialLink: { // 社交链接,如不需要展示可以留空白,例如 weibo:'' weibo: 'https://weibo.com/tangly1024', twitter: 'https://twitter.com/troy1024_1', diff --git a/components/Analytics.js b/components/Analytics.js deleted file mode 100644 index c7655654..00000000 --- a/components/Analytics.js +++ /dev/null @@ -1,22 +0,0 @@ -import { useGlobal } from '@/lib/global' - -/** - * 统计网站信息 - * @param {*} param0 - * @returns - */ -export default function Analytics ({ postCount }) { - const { locale } = useGlobal() - - return <> - {/*
{locale.COMMON.ANALYTICS}
*/} -
- - {postCount}{locale.COMMON.POSTS} - - | {locale.COMMON.VISITORS} - {/* - | {locale.COMMON.VIEWS} */} -
- -} diff --git a/components/CommonHead.js b/components/CommonHead.js index 784795a0..9f9a3c2c 100644 --- a/components/CommonHead.js +++ b/components/CommonHead.js @@ -36,7 +36,7 @@ const CommonHead = ({ meta }) => { - {meta.type === 'article' && ( + {meta?.type === 'article' && ( <> { +const CommonScript = () => { return (<> {BLOG.comment?.DaoVoiceId && (<> {/* DaoVoice 反馈 */} @@ -109,4 +109,4 @@ const ThirdPartyScript = () => { ) } -export default ThirdPartyScript +export default CommonScript diff --git a/components/NavBar.js b/components/NavBar.js deleted file mode 100644 index 7aaa48c5..00000000 --- a/components/NavBar.js +++ /dev/null @@ -1,120 +0,0 @@ -import { useEffect, useRef } from 'react' -import Link from 'next/link' -import BLOG from '@/blog.config' -import Image from 'next/image' -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' -import { faBars } from '@fortawesome/free-solid-svg-icons' - -const NavBar = () => { - const links = [] - return ( -
- -
- ) -} - -const Header = ({ navBarTitle, fullWidth = true }) => { - const navRef = useRef(null) - const sentinelRef = useRef([]) - // 当Header移出屏幕时改变的样式 - const handler = ([entry]) => { - if (navRef && navRef.current) { - if (!entry.isIntersecting && entry !== undefined) { - navRef.current.classList.add('sticky-nav-full') - } else { - navRef.current.classList.remove('sticky-nav-full') - } - } - } - useEffect(() => { - const observer = new window.IntersectionObserver(handler) - observer.observe(sentinelRef.current) - // Don't touch this, I have no idea how it works XD - // return () => { - // if (sentinalRef.current) obvserver.unobserve(sentinalRef.current) - // } - }, [sentinelRef]) - return ( - <> - {BLOG.autoCollapsedNavBar === true && ( -