Migrate to typescript

This commit is contained in:
prototypa
2023-01-02 10:51:51 -05:00
parent ba0e67b55f
commit f158d32181
28 changed files with 172 additions and 85 deletions

View File

@ -6,8 +6,13 @@ import { getPermalink } from '~/utils/permalinks';
import { findImage } from '~/utils/images';
import { getFormattedDate } from '~/utils/utils';
const { post } = Astro.props;
import type { Post } from '~/utils/posts';
export interface Props {
post: Post;
}
const { post } = Astro.props;
const image = await findImage(post.image);
---
@ -47,7 +52,7 @@ const image = await findImage(post.image);
<footer class="mt-4">
<div>
<span class="text-gray-500 dark:text-slate-400">
<time datetime={post.publishDate}>{getFormattedDate(post.publishDate)}</time> ~
<time datetime={String(post.publishDate)}>{getFormattedDate(post.publishDate)}</time> ~
{Math.ceil(post.readingTime)} min read
</span>
</div>