From 26f0f634be29bb7e21b7f8e2be88f3636457564e Mon Sep 17 00:00:00 2001 From: KazooTTT Date: Fri, 26 Jul 2024 00:32:10 +0800 Subject: [PATCH] feat: add category and finished --- src/components/blog/Hero.astro | 23 +++++++++++++++++++++++ src/components/blog/PostPreview.astro | 2 +- src/icons/category.svg | 1 + src/icons/progress.svg | 1 + src/layouts/BlogPost.astro | 4 ++-- 5 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 src/icons/category.svg create mode 100644 src/icons/progress.svg diff --git a/src/components/blog/Hero.astro b/src/components/blog/Hero.astro index f4db0a4..ed59400 100644 --- a/src/components/blog/Hero.astro +++ b/src/components/blog/Hero.astro @@ -2,6 +2,9 @@ import type { CollectionEntry } from 'astro:content' import { Image } from 'astro:assets' import FormattedDate from '../FormattedDate.astro' +import Card from '../Card.astro' +import { Icon } from 'astro-icon/components' +import Label from '../Label.astro' interface Props { content: CollectionEntry<'post'> @@ -32,11 +35,23 @@ const dateTimeOptions: Intl.DateTimeFormatOptions = { ) } {data.draft ? (Draft) : null} +

/{' '} {remarkPluginFrontmatter.minutesRead}

+ + +

{data.title} @@ -79,6 +94,14 @@ const dateTimeOptions: Intl.DateTimeFormatOptions = { ) } +{ + (data.description + '').trim().length > 0 && ( + +
{data.description}
+
+ ) +} +