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/components/BlogPostCard.js b/components/BlogPostCard.js index cbd81044..9ef97a0b 100644 --- a/components/BlogPostCard.js +++ b/components/BlogPostCard.js @@ -6,14 +6,15 @@ import Image from 'next/image' import Link from 'next/link' import React from 'react' import { Code, Collection, CollectionRow, Equation, NotionRenderer } from 'react-notion-x' +import Card from './Card' import TagItemMini from './TagItemMini' const BlogPostCard = ({ post, showSummary }) => { const { locale } = useGlobal() const showPreview = BLOG.home?.showPreview && post.blockMap return ( -
+ +
@@ -74,6 +75,8 @@ const BlogPostCard = ({ post, showSummary }) => { )}
+ + ) } diff --git a/components/Card.js b/components/Card.js new file mode 100644 index 00000000..bd7683b8 --- /dev/null +++ b/components/Card.js @@ -0,0 +1,9 @@ +const Card = ({ children, headerSlot, className }) => { + return
+ <>{headerSlot} +
+ {children} +
+
+} +export default Card diff --git a/components/CategoryGroup.js b/components/CategoryGroup.js index 7b521616..e768757f 100644 --- a/components/CategoryGroup.js +++ b/components/CategoryGroup.js @@ -12,7 +12,7 @@ const CategoryGroup = ({ currentCategory, categories }) => { + ' text-sm w-full items-center duration-300 px-2 cursor-pointer py-1 font-light'}> {category}({categories[category]}) diff --git a/components/Collapse.js b/components/Collapse.js index baca44cc..2b68ad73 100644 --- a/components/Collapse.js +++ b/components/Collapse.js @@ -28,7 +28,7 @@ const Collapse = props => { } }, [props.isOpen]) return ( -
+
{props.children}
) diff --git a/components/Footer.js b/components/Footer.js index c0f4f7a1..c35eb512 100644 --- a/components/Footer.js +++ b/components/Footer.js @@ -1,7 +1,6 @@ import { faCopyright, faEye, faShieldAlt, faUsers } from '@fortawesome/free-solid-svg-icons' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import React from 'react' -import Link from 'next/link' import BLOG from '@/blog.config' const Footer = ({ title }) => { @@ -14,7 +13,7 @@ const Footer = ({ title }) => { {` ${y}`} {BLOG.author}. Powered by Notion & NotionNext.
闽ICP备20010331号 - 隐私政策 + {/* 隐私政策 */} pv diff --git a/components/LatestPostsGroup.js b/components/LatestPostsGroup.js index 76c20c62..135027ad 100644 --- a/components/LatestPostsGroup.js +++ b/components/LatestPostsGroup.js @@ -19,16 +19,16 @@ const LatestPostsGroup = ({ posts }) => { const currentPath = useRouter().asPath const { locale } = useGlobal() - return
-
+ return <> +
{locale.COMMON.LATEST_POSTS}
{posts.map(post => { const selected = currentPath === `${BLOG.path}/article/${post.slug}` return ( - -
+
{post.title}
@@ -37,6 +37,6 @@ const LatestPostsGroup = ({ posts }) => { ) })} -
+ } export default LatestPostsGroup diff --git a/components/MenuButtonGroup.js b/components/MenuButtonGroup.js index 50d4d817..aef72bc5 100644 --- a/components/MenuButtonGroup.js +++ b/components/MenuButtonGroup.js @@ -23,7 +23,7 @@ const MenuButtonGroup = ({ allowCollapse = false, postCount }) => { if (link.show) { const selected = (router.pathname === link.to) || (router.asPath === link.to) return -
diff --git a/components/SideAreaLeft.js b/components/SideAreaLeft.js index 51c1bb81..7e406901 100644 --- a/components/SideAreaLeft.js +++ b/components/SideAreaLeft.js @@ -8,6 +8,7 @@ import Analytics from './Analytics' import Tabs from '@/components/Tabs' import BLOG from '@/blog.config' import Logo from './Logo' +import Card from './Card' /** * 侧边平铺 @@ -30,17 +31,16 @@ const SideAreaLeft = ({ title, tags, currentTag, post, postCount, categories, cu {/* 菜单 */}
-
+
- {BLOG.menu.showSearch &&
+ {BLOG.menu.showSearch &&
}
- -
+ {showToc && (
@@ -53,7 +53,7 @@ const SideAreaLeft = ({ title, tags, currentTag, post, postCount, categories, cu
-
+ } diff --git a/components/SideAreaRight.js b/components/SideAreaRight.js index 87aa39e8..fb76fb09 100644 --- a/components/SideAreaRight.js +++ b/components/SideAreaRight.js @@ -1,9 +1,10 @@ import BLOG from '@/blog.config' import { useGlobal } from '@/lib/global' -import { faAngleDoubleRight, faAngleRight, faTags, faThList } from '@fortawesome/free-solid-svg-icons' +import { faAngleDoubleRight, faAngleRight, faTag, faThList } from '@fortawesome/free-solid-svg-icons' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import Link from 'next/link' import React from 'react' +import Card from './Card' import CategoryGroup from './CategoryGroup' import TagGroups from './TagGroups' @@ -38,25 +39,25 @@ const SideAreaRight = ({ return (