Rewrite markdown image URLs and render feature images

This commit is contained in:
2025-11-17 16:26:20 +08:00
parent 2b573024c5
commit 48521d6f5c
5 changed files with 235 additions and 161 deletions

View File

@@ -33,6 +33,15 @@ export default function StaticPage({ params }: Props) {
return (
<article className="prose dark:prose-invert max-w-none">
<h1>{page.title}</h1>
{page.feature_image && (
// feature_image is stored as "../assets/xyz", serve from "/assets/xyz"
// eslint-disable-next-line @next/next/no-img-element
<img
src={page.feature_image.replace('../assets', '/assets')}
alt={page.title}
className="my-4 rounded"
/>
)}
<div dangerouslySetInnerHTML={{ __html: page.body.html }} />
</article>
);