- Blog -
-- Thoughts, skill, and tutorials about front-end development. -
--
+
-
{posts.length > 0 ? (
- posts.map((post) =>
From 144e19871a37433d8fad686c18cddc0ba65f7b4d Mon Sep 17 00:00:00 2001 From: Chocolate1999 <2816778271@qq.com> Date: Sun, 11 Sep 2022 19:12:56 +0800 Subject: [PATCH] feat: new blog page --- src/components/content/blog/BlogCard.tsx | 65 ++++++-------- src/components/layout/Icon.tsx | 4 +- src/contents/blog/02-didi copy.mdx | 110 +++++++++++++++++++++++ src/contents/blog/03 test copy.mdx | 10 +++ src/contents/blog/03 test.mdx | 10 +++ src/pages/blog.tsx | 32 ++++--- 6 files changed, 181 insertions(+), 50 deletions(-) create mode 100644 src/contents/blog/02-didi copy.mdx create mode 100644 src/contents/blog/03 test copy.mdx create mode 100644 src/contents/blog/03 test.mdx diff --git a/src/components/content/blog/BlogCard.tsx b/src/components/content/blog/BlogCard.tsx index 566d175..8b056e5 100644 --- a/src/components/content/blog/BlogCard.tsx +++ b/src/components/content/blog/BlogCard.tsx @@ -4,7 +4,6 @@ import { HiOutlineClock, HiOutlineEye } from 'react-icons/hi'; import Accent from '@/components/Accent'; import Tag from '@/components/content/Tag'; -import CloudinaryImg from '@/components/images/CloudinaryImg'; import UnstyledLink from '@/components/links/UnstyledLink'; import { BlogFrontmatter, InjectedMeta } from '@/types/frontmatters'; @@ -36,20 +35,36 @@ export default function BlogCard({ className='block h-full rounded-md focus:outline-none focus-visible:ring focus-visible:ring-primary-300' href={`/blog/${post.slug}`} > -
+ + {format( + new Date(post.lastUpdated ?? post.publishedAt), + 'MMMM dd, yyyy' + )} + +
++ {post.description} +
+- - {format( - new Date(post.lastUpdated ?? post.publishedAt), - 'MMMM dd, yyyy' - )} - -
-- {post.description} -
-