Implement Markdown-based News Feed (/news) and Blog Post Pages
Background
The Adoptium website uses Markdown files under content/blog/ to manage community blog posts and announcements. Each blog post lives in its own subdirectory (with an index.md and optional images or PDFs). In the Next.js migration, we need to replicate this functionality by creating a /news landing page that lists all posts, and individual blog pages under /news/<year>/<month>/<slug>/.
The posts use frontmatter for metadata (title, date, author, description, and tags), and may contain rich Markdown content including links, images, and code blocks.
Requirements
-
[x] Directory and data source
- Use the existing Markdown files located under
content/blog/. - Each blog lives in a directory with
index.mdand optional media files (e.g.,*.jpg,*.pdf). - These Markdown files should be parsed at build time (SSG) using a library such as
gray-matter(for frontmatter) andremark/rehypeorMDXfor content rendering.
- Use the existing Markdown files located under
-
[x] Route structure
-
The
/newspath should list all blog posts in reverse chronological order. -
Each individual post must be accessible at
/news/<year>/<month>/<slug>/.- For example,
content/blog/eclipse-temurin-23-available/index.md(dated 2024-05-28) should be available at/news/2024/05/eclipse-temurin-23-available/.
- For example,
-
-
[x] Slug generation
- Use the directory name (not the filename) in
content/blog/as the slug. - Parse the frontmatter
dateto generate the<year>and<month>route segments. - Ensure slugs are URL-safe and consistent with existing links.
- Use the directory name (not the filename) in
-
[x] News listing page (
/news)-
Display a paginated list of blog post previews sorted by
datedescending. -
Each preview should include:
titledescription(from frontmatter)authordate(formatted e.g. "28 May 2024")tags(optional, can be used later for filtering)
-
Each preview should link to the full blog post URL.
-
-
[x] Blog post detail pages
- Render full Markdown content from
index.md. - Resolve local image paths (e.g.,
./workflow.jpg) relative to the post’s folder. - Optionally support PDF links or downloads (e.g.,
Adoptium-Community-Day-EclipseCon2022.pdf). - Set dynamic
title,meta description, andog:imagetags for SEO and social sharing (using frontmatter).
- Render full Markdown content from
-
[x] Error handling
- Show a custom 404 page if the post doesn’t exist.
- Gracefully skip malformed or missing frontmatter (log a build warning).
Tech Suggestions
- Use
gray-matterto extract frontmatter. - Use
next-mdx-remote,@next/mdx, orremark/rehypeto render Markdown safely. - Use
fsandpathin a utility file (e.g.,lib/blog.ts) to recursively read blog folders and construct metadata objects for each post. - Use static generation (
getStaticPathsandgetStaticProps) to build all blog routes at compile time.
Bonus (Optional)
- [x] Add RSS feed generation for
/news/feed.xml. - [x] Add tag support for filtering or grouping posts.
- [ ] Add estimated reading time (
readingTimepackage).
Acceptance Criteria
- Visiting
/newsshows a reverse-chronological list of all blog posts. - Blog posts can be visited at
/news/<year>/<month>/<slug>/with working content and media. - The Markdown content renders correctly with all expected formatting (e.g., code blocks, links, images).
- All posts use the correct frontmatter metadata.
- No
enoren-GBtranslation files are required for the blog — blog posts are English-only for now.
Let me know if you’d like a follow-up issue to support internationalisation of blog posts in future.
Hey @gdams, would like to take this one forward