parent
f75579806b
commit
3179c95e4e
6 changed files with 32 additions and 53 deletions
@ -1,37 +1,39 @@ |
||||
--- |
||||
import type { ChangelogFileType } from '../../lib/changelog'; |
||||
import { DateTime } from 'luxon'; |
||||
import MarkdownFile from '../MarkdownFile.astro'; |
||||
|
||||
interface Props { |
||||
changelog: ChangelogFileType; |
||||
} |
||||
|
||||
const { changelog } = Astro.props; |
||||
const { frontmatter } = changelog; |
||||
const { data: frontmatter } = changelog; |
||||
const { Content } = await changelog.render(); |
||||
|
||||
const formattedDate = DateTime.fromISO(frontmatter.date).toFormat( |
||||
const formattedDate = DateTime.fromJSDate(frontmatter.date).toFormat( |
||||
'dd LLL, yyyy', |
||||
); |
||||
--- |
||||
|
||||
<div class='relative'> |
||||
<span class='h-2 w-2 flex-shrink-0 rounded-full bg-gray-300 absolute top-2 -left-6'></span> |
||||
<span |
||||
class='absolute -left-6 top-2 h-2 w-2 flex-shrink-0 rounded-full bg-gray-300' |
||||
></span> |
||||
|
||||
<div class='mb-3 flex items-center gap-2'> |
||||
<span class='flex-shrink-0 text-xs tracking-wide text-gray-400'> |
||||
{formattedDate} |
||||
</span> |
||||
<span class='truncate text-base font-medium'> |
||||
{changelog.frontmatter.title} |
||||
{frontmatter.title} |
||||
</span> |
||||
</div> |
||||
|
||||
<div class='rounded-xl border bg-white p-6'> |
||||
<div |
||||
class='prose prose-h2:text-lg prose-h2:font-medium prose-h2:mt-3 prose-sm prose-p:mb-0 prose-blockquote:font-normal prose-blockquote:text-gray-500 prose-ul:my-0 prose-img:mt-0 prose-img:rounded-lg [&>blockquote>p]:mt-0 prose-ul:bg-gray-100 prose-ul:rounded-lg prose-ul:px-4 prose-ul:py-4 prose-ul:pl-7 [&>ul>li]:my-0 [&>ul>li]:mb-1 [&>ul]:mt-3' |
||||
class='prose prose-sm prose-h2:mt-3 prose-h2:text-lg prose-h2:font-medium prose-p:mb-0 prose-blockquote:font-normal prose-blockquote:text-gray-500 prose-ul:my-0 prose-ul:rounded-lg prose-ul:bg-gray-100 prose-ul:px-4 prose-ul:py-4 prose-ul:pl-7 prose-img:mt-0 prose-img:rounded-lg [&>blockquote>p]:mt-0 [&>ul>li]:my-0 [&>ul>li]:mb-1 [&>ul]:mt-3' |
||||
> |
||||
<changelog.Content /> |
||||
<Content /> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
@ -0,0 +1,16 @@ |
||||
import { defineCollection, z } from 'astro:content'; |
||||
|
||||
export const changelogCollection = defineCollection({ |
||||
type: 'content', |
||||
schema: z.object({ |
||||
title: z.string(), |
||||
description: z.string(), |
||||
seo: z |
||||
.object({ |
||||
title: z.string(), |
||||
description: z.string().optional(), |
||||
}) |
||||
.optional(), |
||||
date: z.date(), |
||||
}), |
||||
}); |
Loading…
Reference in new issue