*/} - -
*/} + + + + {/* Notion文章主体 */} +
+ {(!showPreview || showSummary) &&
{post.summary}
} - {BLOG.home?.showPreview && post?.blockMap &&diff --git a/README.md b/README.md index 3df2f387..d805890d 100644 --- a/README.md +++ b/README.md @@ -44,20 +44,21 @@ - 使用 Tailwind CSS,轻松实现二次开发 **🕸 网址美观、搜索引擎优化** +- 更多特性、欢迎移步[我的博客](https://tangly1024.com/article/notion-next)查看 + +## 更新日志 +请移步 [更新文档](https://docs.tangly1024.com/zh/changelog)查看 -## 更多特性 -欢迎移步[我的博客](https://tangly1024.com/article/notion-next)查看 ## 快速起步 - 给这个项目点个小星星 😉 - 将 [这个 Notion 模板](https://tanghh.notion.site/02ab3b8678004aa69e9e415905ef32a5) 制作副本,并分享这个页面给所有人 - [Fork](https://github.com/tangly1024/NotionNext/fork) 这个项目 -- 在 `blog.config.js` 配置相关选项,更多关于配置的说明,请移步[NotionNext文档](https://docs.tangly1024.com/zh) - _(可选)_ 用自己的图片替换 `/public` 文件夹里的 `avatar.jpg`、`favicon.svg` 和 `favicon.ico` - 在 [Vercel](https://vercel.com) 上部署这个项目, 设定一下环境变量: - `NOTION_PAGE_ID`: 你刚刚分享出去的 Notion 页面网址中的页面 ID,通常是网址中工作区地址后的 32 位字符串 - - `NOTION_ACCESS_TOKEN`(可选): 如果你决定不分享你的数据库,你可以使用 token 来让网页从 Notion 数据库中抓取数据。你可以在你的浏览器 cookies 中找到它,名称是 `token_v2'。 - - Notion token 的有效期只有 180 天,请确保在 Vercel Dashboard 上手动更新,我们可能会在未来切换到官方 API 来解决这个问题。此外,如果数据库是非公开到,Notion 中的图片可能无法正常显示到网页上。 +- 在 `blog.config.js` 配置相关选项,更多关于配置的说明,请移步[NotionNext文档](https://docs.tangly1024.com/zh) + - **稍微等等就可以访问了!** 简单吗? @@ -76,10 +77,10 @@ yarn run start # 本地启动NextJS服务 ## 引用技术 -- **生成**: Next.js SSG 和 Incremental Static Regeneration -- **页面渲染**: [React-notion-x](https://github.com/NotionX/react-notion-x) -- **样式**: Tailwind CSS 和 `@tailwindcss/jit` compiler -- **评论**: Gitalk,Cusdis,Utterances +- **框架**: Next.js +- **渲染**: [React-notion-x](https://github.com/NotionX/react-notion-x) +- **样式**: [Tailwind CSS](https://www.tailwindcss.cn/) 和 `@tailwindcss/jit` compiler +- **评论**: Gitalk, Cusdis, Utterances - **图标**:[fontawesome](https://fontawesome.com/v5.15/icons?d=gallery) ## 页面样式主题 diff --git a/blog.config.js b/blog.config.js index 059ad0a9..d35bb178 100644 --- a/blog.config.js +++ b/blog.config.js @@ -12,6 +12,7 @@ const BLOG = { 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. @@ -38,8 +39,8 @@ const BLOG = { 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: true, // 显示回底 - showDarkMode: true, // 显示日间/夜间模式切换 + showToBottom: false, // 显示回底 + showDarkMode: false, // 显示日间/夜间模式切换 showToc: true, // 移动端显示悬浮目录 showShareBar: false, // 文章分享功能 showRelatePosts: true, // 相关文章推荐 @@ -55,13 +56,13 @@ const BLOG = { telegram: 'https://t.me/tangly_1024' }, comment: { // 评论插件,支持 gitalk, utterances, cusdis - provider: '', // 不需要则留空白 + provider: 'gitalk', // 不需要则留空白 gitalkConfig: { repo: 'NotionNext', // The repository of store comments owner: 'tangly1024', admin: ['tangly1024'], - clientID: 'be7864a16b693e256f8f', - clientSecret: 'dbd0f6d9ceea8940f6ed20936b415274b8fe66a2', + clientID: process.env.GITALK_ID || 'be7864a16b693e256f8f', + clientSecret: process.env.GITALK_SECRET || 'dbd0f6d9ceea8940f6ed20936b415274b8fe66a2', distractionFreeMode: false }, cusdisConfig: { diff --git a/components/Analytics.js b/components/Analytics.js index fbd23538..c7655654 100644 --- a/components/Analytics.js +++ b/components/Analytics.js @@ -13,10 +13,10 @@ export default function Analytics ({ postCount }) {
+ {(!showPreview || showSummary) &&
{post.summary}
} - {BLOG.home?.showPreview && post?.blockMap &&