Images in the blog: paths, covers, and figures
- Markdown
- Next.js
- Accessibility
- Images
Images in the blog: paths, covers, and figures
This post shows how to store local images under frontend/public/posts/2026/ and reference them with absolute paths (/posts/2026/...).
Cover and card image
The frontmatter image field uses the same asset as the hero: /posts/2026/guide-images-cover.svg.
Inline figure
The diagram below summarizes the flow: files live in public/, URLs are rooted at the site origin.
Best practices
- Name files without spaces (
guide-images-cover.svg). - Prefer
/posts/2026/my-file.pnginstead of paths relative to the post slug. - Provide meaningful
alttext for accessibility.
Example Markdown
 renders a responsive image for local paths via Next.js.
External image
You can also link to a remote asset (CDN):
![]()
In production, review your CSP when loading third-party domains.
Conclusion
Markdown + frontmatter plus assets in frontend/public/posts/YYYY/ keeps posts easy to review in Git while displaying well on the platform.