From 0063ef8fe1b5a97745ad71bda0ca6b530cead58d Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Thu, 29 Jun 2023 16:06:29 +0800 Subject: [PATCH 1/2] fix build fukasawa --- blog.config.js | 2 +- themes/fukasawa/components/BlogListPage.js | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/blog.config.js b/blog.config.js index 6e2ff263..c6c9faea 100644 --- a/blog.config.js +++ b/blog.config.js @@ -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 || 'hexo', // 主题, 支持 ['next','hexo',"fukasawa','medium','example','matery','gitbook','simple'] @see https://preview.tangly1024.com + THEME: process.env.NEXT_PUBLIC_THEME || 'fukasawa', // 主题, 支持 ['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. diff --git a/themes/fukasawa/components/BlogListPage.js b/themes/fukasawa/components/BlogListPage.js index ad2bdbb3..3ef8dee3 100644 --- a/themes/fukasawa/components/BlogListPage.js +++ b/themes/fukasawa/components/BlogListPage.js @@ -1,5 +1,5 @@ import BLOG from '@/blog.config' -import { deepClone } from '@/lib/utils' +import { deepClone, isBrowser } from '@/lib/utils' import BlogCard from './BlogCard' import BlogPostListEmpty from './BlogListEmpty' import PaginationSimple from './PaginationSimple' @@ -65,13 +65,21 @@ const BlogListPage = ({ page = 1, posts = [], postCount, siteInfo }) => { } } +/** + * 计算文章列数 + * @returns + */ const calculateColumns = () => { - if (window.innerWidth >= 1024) { + if (!isBrowser()) { return 3 - } else if (window.innerWidth >= 640) { - return 2 } else { - return 1 + if (window.innerWidth >= 1024) { + return 3 + } else if (window.innerWidth >= 640) { + return 2 + } else { + return 1 + } } } From ab6b7539ffee0af12ab5d5578307d5a7c8783381 Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Thu, 29 Jun 2023 16:06:59 +0800 Subject: [PATCH 2/2] 3.16.2 --- .env.local | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.env.local b/.env.local index 9920d134..527622a4 100644 --- a/.env.local +++ b/.env.local @@ -1,2 +1,2 @@ # 环境变量 @see https://www.nextjs.cn/docs/basic-features/environment-variables -NEXT_PUBLIC_VERSION=3.16.1 \ No newline at end of file +NEXT_PUBLIC_VERSION=3.16.2 \ No newline at end of file diff --git a/package.json b/package.json index b380603f..18527c97 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "notion-next", - "version": "3.16.1", + "version": "3.16.2", "homepage": "https://github.com/tangly1024/NotionNext.git", "license": "MIT", "repository": {