Update Blog Articles with tags

This commit is contained in:
dealjus 2025-04-27 00:13:55 -07:00
parent 89bd35218f
commit a57b48af3a
4 changed files with 23 additions and 6 deletions

View File

@ -8,22 +8,30 @@ export type Props = {
url: string; url: string;
duration?: string; duration?: string;
timestamp?: string; timestamp?: string;
tags?: string[];
}; };
const { title, description, url, duration, timestamp } = Astro.props; const { title, description, url, duration, timestamp, tags } = Astro.props;
--- ---
<div class="zag-text zag-transition flex flex-col gap-3 pb-8"> <div class="zag-text zag-transition flex flex-col gap-3 pb-8">
<Anchor url={url} class="text-xl"> <Anchor url={url} class="text-xl">
{title} {title}
</Anchor> </Anchor>
<p class="">
{description}
</p>
<div <div
class="zag-muted zag-transition flex justify-between items-center" class="zag-muted zag-transition flex justify-between items-center"
> >
{timestamp ? <p>{processArticleDate(timestamp)}</p> : null} {timestamp ? <p>{processArticleDate(timestamp)}</p> : null}
{duration ? <p>{duration}</p> : null} {duration ? <p>{duration}</p> : null}
</div> </div>
<p class="">
{description}
</p>
<div class="flex flex-wrap gap-2">
{tags?.map((tag: string) => (
<span class="-zag-text -zag-bg zag-transition px-2 py-1 text-sm font-semibold">
{tag}
</span>
))}
</div>
</div> </div>

View File

@ -26,6 +26,7 @@ const { featuredArticles } = Astro.props;
url={article.filename} url={article.filename}
timestamp={article.timestamp} timestamp={article.timestamp}
duration={`${article.time} min`} duration={`${article.time} min`}
tags={article.tags}
/> />
</li> </li>
)) ))

View File

@ -50,6 +50,13 @@ const sourceUrl = generateSourceUrl(frontmatter.filename, "blog");
<Prose> <Prose>
<slot /> <slot />
</Prose> </Prose>
<div class="flex flex-wrap gap-2 mt-4">
{frontmatter.tags?.map((tag) => (
<span class="-zag-text -zag-bg zag-transition px-2 py-1 text-sm font-semibold">
{tag}
</span>
))}
</div>
<p class="pt-8">~{GLOBAL.username}</p> <p class="pt-8">~{GLOBAL.username}</p>
</Section> </Section>
</Layout> </Layout>

View File

@ -46,6 +46,7 @@ import { articles } from "../../lib/list";
duration={`${project.time} min`} duration={`${project.time} min`}
url={project.filename} url={project.filename}
timestamp={project.timestamp} timestamp={project.timestamp}
tags={project.tags}
/> />
</li> </li>
)) ))