diff --git a/blog.config.js b/blog.config.js index 258ef3fd..54ac8cd3 100644 --- a/blog.config.js +++ b/blog.config.js @@ -5,6 +5,7 @@ const BLOG = { AUTHOR: 'tangly1024', // 作者 BIO: '一个普通的干饭人🍚', // 作者简介 LINK: 'https://tangly1024.com', // 网站地址 + AVATAR: '/avatar.png', // 个人头像 默认取public目录下的avatar.png KEYWORDS: 'Notion, 博客', // 网站关键词 英文逗号隔开 NOTION_PAGE_ID: process.env.NOTION_PAGE_ID || '02ab3b8678004aa69e9e415905ef32a5', // Important page_id!!!Duplicate Template from https://www.notion.so/tanghh/02ab3b8678004aa69e9e415905ef32a5 NOTION_ACCESS_TOKEN: process.env.NOTION_ACCESS_TOKEN || '', // Useful if you prefer not to make your database public @@ -51,7 +52,7 @@ const BLOG = { COMMENT_GITALK_ADMIN: process.env.NEXT_PUBLIC_COMMENT_GITALK_ADMIN || '', // 管理员用户名、一般是自己 e.g 'tangly1024' COMMENT_GITALK_CLIENT_ID: process.env.NEXT_PUBLIC_COMMENT_GITALK_CLIENT_ID || '', // e.g 20位ID , 在gitalk后台获取 COMMENT_GITALK_CLIENT_SECRET: process.env.NEXT_PUBLIC_COMMENT_GITALK_CLIENT_SECRET || '', // e.g 40位ID, 在gitalk后台获取 - COMMENT_GITALK_DISTRACTION_FREE_MODE: false, + COMMENT_GITALK_DISTRACTION_FREE_MODE: false, // 类似facebook的无干扰模式 COMMENT_GITTER_ROOM: process.env.NEXT_PUBLIC_COMMENT_GITTER_ROOM || '', // gitter聊天室 see https://gitter.im/ 不需要则留空 COMMENT_DAO_VOICE_ID: process.env.NEXT_PUBLIC_COMMENT_DAO_VOICE_ID || '', // DaoVoice http://dashboard.daovoice.io/get-started @@ -71,7 +72,8 @@ const BLOG = { ADSENSE_GOOGLE_ID: process.env.NEXT_PUBLIC_ADSENSE_GOOGLE_ID || '', // 谷歌广告ID e.g ca-pub-xxxxxxxxxxxxxxxx - 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) + 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) + VERSION: '2.7.1' // 版本号 } module.exports = BLOG diff --git a/components/Comment.js b/components/Comment.js index 82be7170..87ae86dc 100644 --- a/components/Comment.js +++ b/components/Comment.js @@ -25,6 +25,22 @@ const Comment = ({ frontMatter }) => { return (
+ + {BLOG.COMMENT_GITALK_CLIENT_ID && (
+ +
)} + {BLOG.COMMENT_UTTERRANCES_REPO && (
)} @@ -41,21 +57,6 @@ const Comment = ({ frontMatter }) => { }} />
)} - - {BLOG.COMMENT_GITALK_CLIENT_ID && (
- -
)} ) diff --git a/components/Tabs.js b/components/Tabs.js index 56a44478..a6a9b1d9 100644 --- a/components/Tabs.js +++ b/components/Tabs.js @@ -10,13 +10,19 @@ const Tabs = ({ className, children }) => { return <> } - let count = children.length + children = children.filter(c => c !== '') + + let count = 0 children.forEach(e => { - if (!e) { - count-- + if (e) { + count++ } }) + if (count === 0) { + return <> + } + if (count === 1) { return
{children} diff --git a/lib/global.js b/lib/global.js index 59b9e506..b146523f 100644 --- a/lib/global.js +++ b/lib/global.js @@ -29,7 +29,6 @@ export function GlobalContextProvider ({ children }) { useEffect(() => { if (!hasInit) { const userTheme = getQueryVariable('theme') - console.log('用户主题', userTheme) if (userTheme && ALL_THEME.indexOf(userTheme) > -1) { setTheme(userTheme) } diff --git a/package.json b/package.json index 9a7a661c..ed8a9d31 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "notion-next", - "version": "1.0.0", + "version": "2.7.1", "homepage": "https://github.com/tangly1024/NotionNext.git", "license": "MIT", "repository": { diff --git a/public/avatar.png b/public/avatar.png new file mode 100644 index 00000000..ba9f1dc1 Binary files /dev/null and b/public/avatar.png differ diff --git a/themes/fukasawa/components/BlogCard.js b/themes/fukasawa/components/BlogCard.js index e153e414..fbe866bf 100644 --- a/themes/fukasawa/components/BlogCard.js +++ b/themes/fukasawa/components/BlogCard.js @@ -13,7 +13,7 @@ const BlogCard = ({ post, showSummary }) => {
- + {post.title} diff --git a/themes/fukasawa/components/BlogListPage.js b/themes/fukasawa/components/BlogListPage.js index afc7f6f7..51c1c6c1 100644 --- a/themes/fukasawa/components/BlogListPage.js +++ b/themes/fukasawa/components/BlogListPage.js @@ -14,8 +14,8 @@ import PaginationSimple from './PaginationSimple' */ const BlogListPage = ({ page = 1, posts = [], postCount }) => { const totalPage = Math.ceil(postCount / BLOG.POSTS_PER_PAGE) - const showNext = page < totalPage && posts.length <= BLOG.POSTS_PER_PAGE && posts.length < postCount - const [colCount, changeCol] = useState(3) + const showNext = page < totalPage && posts.length === BLOG.POSTS_PER_PAGE && posts.length < postCount + const [colCount, changeCol] = useState(1) function updateCol () { if (window.outerWidth > 1200) { diff --git a/themes/fukasawa/components/Catalog.js b/themes/fukasawa/components/Catalog.js index f5150983..477a325e 100644 --- a/themes/fukasawa/components/Catalog.js +++ b/themes/fukasawa/components/Catalog.js @@ -51,7 +51,7 @@ const Catalog = ({ toc }) => { }, throttleMs)) return
-
目录
+
目录