Update Blog Articles with tags
This commit is contained in:
parent
89bd35218f
commit
a57b48af3a
@ -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>
|
||||||
|
<div
|
||||||
|
class="zag-muted zag-transition flex justify-between items-center"
|
||||||
|
>
|
||||||
|
{timestamp ? <p>{processArticleDate(timestamp)}</p> : null}
|
||||||
|
{duration ? <p>{duration}</p> : null}
|
||||||
|
</div>
|
||||||
<p class="">
|
<p class="">
|
||||||
{description}
|
{description}
|
||||||
</p>
|
</p>
|
||||||
<div
|
<div class="flex flex-wrap gap-2">
|
||||||
class="zag-muted zag-transition flex justify-between items-center"
|
{tags?.map((tag: string) => (
|
||||||
>
|
<span class="-zag-text -zag-bg zag-transition px-2 py-1 text-sm font-semibold">
|
||||||
{timestamp ? <p>{processArticleDate(timestamp)}</p> : null}
|
{tag}
|
||||||
{duration ? <p>{duration}</p> : null}
|
</span>
|
||||||
|
))}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -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>
|
||||||
))
|
))
|
||||||
|
@ -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>
|
||||||
|
@ -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>
|
||||||
))
|
))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user