Add support to MDX in blog

This commit is contained in:
prototypa
2022-10-15 23:35:11 +02:00
parent e7fd6cc72c
commit 11b9782d6e
12 changed files with 41 additions and 19 deletions

View File

@ -43,7 +43,7 @@ const image = await findImage(post.image);
<footer class="mt-4">
<div>
<span class="text-gray-500 dark:text-slate-400">
<time datetime={post.pubDate}>{getFormattedDate(post.pubDate)}</time> ~
<time datetime={post.publishDate}>{getFormattedDate(post.publishDate)}</time> ~
{Math.ceil(post.readingTime)} min read
</span>
</div>

View File

@ -11,7 +11,7 @@ const { post } = Astro.props;
<article>
<header>
<p class="max-w-3xl mx-auto text-center">
<time datetime={post.pubDate}>{getFormattedDate(post.pubDate)}</time> ~ {Math.ceil(post.readingTime)} min read
<time datetime={post.publishDate}>{getFormattedDate(post.publishDate)}</time> ~ {Math.ceil(post.readingTime)} min read
</p>
<h1
class="px-4 sm:px-6 max-w-3xl mx-auto text-center text-4xl md:text-5xl font-bold leading-tighter tracking-tighter mb-8 font-heading"
@ -34,7 +34,7 @@ const { post } = Astro.props;
<div
class="container mx-auto px-6 sm:px-6 max-w-3xl prose prose-lg lg:prose-xl dark:prose-invert dark:prose-headings:text-slate-300 prose-md prose-headings:font-heading prose-headings:leading-tighter prose-headings:tracking-tighter prose-headings:font-bold prose-a:text-primary-600 dark:prose-a:text-primary-400 prose-img:rounded-md prose-img:shadow-lg mt-8"
>
<Fragment set:html={post.body} />
{post.Content ? <post.Content /> : <Fragment set:html={post.body} />}
</div>
<div class="container mx-auto px-8 sm:px-6 max-w-3xl mt-8">
<PostTags tags={post.tags} />