diff --git a/components/BlogPostCard.js b/components/BlogPostCard.js index 56b05e23..430708b2 100644 --- a/components/BlogPostCard.js +++ b/components/BlogPostCard.js @@ -19,18 +19,18 @@ const BlogPostCard = ({ post, tags }) => {
- + {post.category} | - {post.date.start_date} + {post.date.start_date}
-

+

{post.title}

diff --git a/components/CategoryGroup.js b/components/CategoryGroup.js index 2d864400..f4b87ed5 100644 --- a/components/CategoryGroup.js +++ b/components/CategoryGroup.js @@ -12,7 +12,7 @@ const CategoryGroup = ({ currentCategory, categories }) => {
+ ' duration-300 hover:text-blue-500 dark:hover:text-blue-400 hover:underline px-5 cursor-pointer py-2'}> {category}({categories[category]})
})} diff --git a/components/LatestPostsGroup.js b/components/LatestPostsGroup.js index 338f5893..80047da1 100644 --- a/components/LatestPostsGroup.js +++ b/components/LatestPostsGroup.js @@ -38,7 +38,7 @@ const LatestPostsGroup = ({ posts, sliceCount = 5 }) => {
{post.title}
diff --git a/components/MenuButtonGroup.js b/components/MenuButtonGroup.js index af9dff85..788b864d 100644 --- a/components/MenuButtonGroup.js +++ b/components/MenuButtonGroup.js @@ -27,7 +27,7 @@ const MenuButtonGroup = ({ allowCollapse = false }) => { if (link.show) { const selected = (router.pathname === link.to) || (router.asPath === link.to) return -
diff --git a/components/RecommendPosts.js b/components/RecommendPosts.js index a42c81e8..abca15a2 100644 --- a/components/RecommendPosts.js +++ b/components/RecommendPosts.js @@ -25,7 +25,11 @@ const RecommendPosts = ({ currentPost, totalPosts }) => { if (currentPost.tags && currentPost.tags.length) { const currentTag = currentPost.tags[0] filteredPosts = totalPosts.filter( - post => post && post.tags && post.tags.includes(currentTag) && post.slug !== currentPost.slug + post => + post && + post.tags && + post.tags.includes(currentTag) && + post.slug !== currentPost.slug ) } shuffleSort(filteredPosts) @@ -37,13 +41,21 @@ const RecommendPosts = ({ currentPost, totalPosts }) => { const { locale } = useGlobal() - return
-
{locale.COMMON.RELATE_POSTS}
-
-
+ return ( +
+
{locale.COMMON.RELATE_POSTS}
+ +
+ ) } export default RecommendPosts diff --git a/components/TagItem.js b/components/TagItem.js index c9d6a4a7..a3a04866 100644 --- a/components/TagItem.js +++ b/components/TagItem.js @@ -13,7 +13,7 @@ const TagItem = ({ tag, selected }) => {
  • { return -
    + : `text-gray-600 dark:text-gray-600 hover:shadow-xl dark:border-gray-400 notion-${tag.color}_background `}` }>
    {selected && } {tag.name + (tag.count ? `(${tag.count})` : '')}
    diff --git a/lib/notion/getNotionData.js b/lib/notion/getNotionData.js index a6cc5b0e..d7701892 100644 --- a/lib/notion/getNotionData.js +++ b/lib/notion/getNotionData.js @@ -12,7 +12,10 @@ import { getPostBlocks } from '@/lib/notion/getPostBlocks' export async function getNotionPageData ({ pageId = BLOG.notionPageId, from }) { // 尝试从缓存获取 const data = await getDataFromCache('page_record_map_' + pageId) - if (data) return data + if (data) { + console.log('[请求缓存]:', `from:${from}`, `id:${pageId}`) + return data + } const pageRecordMap = await getPageRecordMapByNotionAPI({ pageId, from }) // 存入缓存 if (pageRecordMap) { diff --git a/lib/notion/getPostBlocks.js b/lib/notion/getPostBlocks.js index 299d66d5..ff037545 100644 --- a/lib/notion/getPostBlocks.js +++ b/lib/notion/getPostBlocks.js @@ -5,6 +5,7 @@ import { getDataFromCache, setDataToCache } from '@/lib/cache/cache_manager' export async function getPostBlocks (id, from) { let pageBlock = await getDataFromCache('page_block_' + id) if (pageBlock) { + console.log('[请求缓存]:', `from:${from}`, `id:${id}`) return pageBlock } const authToken = BLOG.notionAccessToken || null diff --git a/pages/article/[slug].js b/pages/article/[slug].js index 39223530..704503b7 100644 --- a/pages/article/[slug].js +++ b/pages/article/[slug].js @@ -100,11 +100,12 @@ const ArticleDetail = ({ post, blockMap, tags, prev, next, allPosts, categories {/* 版权声明 */} -
    -
      +
      +
      版权声明
      +
      • 本文作者: {BLOG.author}
      • 本文链接: {url}
      • -
      • 版权声明: 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
      • +
      • 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!