From bd27bbb073465be77e4e752e6bf9bc4cf5e84c60 Mon Sep 17 00:00:00 2001 From: João Augusto Costa Branco Marado Torres Date: Sun, 27 Jul 2025 12:34:14 -0300 Subject: feat: styling microblogs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: João Augusto Costa Branco Marado Torres --- src/components/templates/MicroBlog.astro | 66 +++++++++++++++++++++++------- src/components/templates/PrevNextNav.astro | 13 +++--- 2 files changed, 60 insertions(+), 19 deletions(-) (limited to 'src/components/templates') diff --git a/src/components/templates/MicroBlog.astro b/src/components/templates/MicroBlog.astro index 88321dc..713e7eb 100644 --- a/src/components/templates/MicroBlog.astro +++ b/src/components/templates/MicroBlog.astro @@ -1,12 +1,17 @@ --- import Date from "@components/organisms/Date.astro"; +import RelativeTime from "@components/organisms/RelativeTime.astro"; import KeywordsList from "@components/organisms/KeywordsList.astro"; import { getFirstUserID, getLastUpdate } from "@lib/collection/helpers"; -import type { Micro, MicroEntry } from "@lib/collection/schemas"; +import type { MicroEntry } from "@lib/collection/schemas"; +import { getRelativeTimeUnit } from "@utils/datetime"; -interface Props extends MicroEntry {} +interface Props { + micro: MicroEntry; + seeAll?: boolean; +} -const micro = Astro.props; +const { micro, seeAll = false } = Astro.props; const { id, data, rendered } = micro; const { title, lang, keywords } = data; const date = getLastUpdate(micro); @@ -20,6 +25,7 @@ const little = ((first?.[0] ?? "") + (last?.[0] ?? "")).slice(0, 2); itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting" + style={`--rows: ${seeAll ? 3 : 2};`} >

@@ -36,35 +42,49 @@ const little = ((first?.[0] ?? "") + (last?.[0] ?? "")).slice(0, 2); itemscope itemtype="https://schema.org/Person" >{first} {last} - · · + /> () + {lang}

- + { + seeAll && ( + + ) + }