feat(page): render changelog markdown

This commit is contained in:
Lars Hampe 2024-11-01 21:14:28 +01:00
parent d867dc4b8a
commit ede09bcf04
3 changed files with 12 additions and 7 deletions

View File

@ -21,6 +21,7 @@
"@types/react-dom": "^18.3.1",
"astro": "^4.16.7",
"date-fns": "^4.1.0",
"marked": "^14.1.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"tailwindcss": "^3.4.14",

View File

@ -3,6 +3,7 @@ import type { PageByIdOutput } from '@boring.tools/schema'
import { Separator } from '@boring.tools/ui'
import type { z } from 'astro/zod'
import { format } from 'date-fns'
import { marked } from 'marked'
type PageById = z.infer<typeof PageByIdOutput>
const url = import.meta.env.DEV
@ -55,9 +56,7 @@ const data: PageById = await response.json()
}
</div>
<p>
{version.markdown}
</p>
<div set:html={marked.parse(version.markdown ?? "")} />
</div>
)
})}
@ -89,10 +88,7 @@ const data: PageById = await response.json()
</p>
}
</div>
<p>
{version.markdown}
</p>
<div class="page" set:html={marked.parse(version.markdown ?? "")} />
</div>
)
})}

View File

@ -85,4 +85,12 @@
"rlig" 1,
"calt" 1;
}
.page h3 {
@apply text-2xl my-2;
}
.page ul {
@apply list-disc ml-6;
}
}