strict typescript

This commit is contained in:
2024-02-18 20:30:10 -05:00
parent 06fce5508a
commit b4fd4e3403
6 changed files with 37 additions and 26 deletions
-2
View File
@@ -15,8 +15,6 @@ const { title, date, slug } = Astro.props;
{slug ? <a href={`/posts/${slug}`}>{title}</a> : title}
</h2>
<h3>
<!-- <img class="svg-icon" src={calendarIcon} alt="" /> -->
🗓️ <FormattedDate date={date} />
</h3>
</div>
+3 -1
View File
@@ -1,4 +1,6 @@
---
import { Tag } from 'src/content/config';
import BlogHeader from '@components/BlogHeader.astro';
import Tags from '@components/Tags.astro';
@@ -6,7 +8,7 @@ interface Post {
data: {
title: string;
pubDate: Date;
tags: string[];
tags: Tag[];
};
slug: string;
}
+4 -2
View File
@@ -1,6 +1,8 @@
---
import { Tag } from 'src/content/config';
interface Props {
tags: string[];
tags: Tag[];
}
const { tags } = Astro.props;
@@ -8,7 +10,7 @@ const { tags } = Astro.props;
<div class="tag-container">
{
tags.sort().map((tag: string) => (
tags.sort().map((tag: Tag) => (
<a class="tag" href={`/archive/${tag}?page=1`}>
#{tag}
</a>