Static-export Next.js site for xdev.asia.
- Next.js 16 App Router
- React 19
- Tailwind CSS 4
- MDX content loaded from
content/
Install dependencies and start the dev server:
npm install
npm run devBuild the static site locally:
npm run buildPrimary content now lives in MDX files:
content/posts/*.mdcontent/series/<slug>/index.mdcontent/series/<slug>/chapters/**/lessons/*.md
The app reads posts and series content from MDX via src/lib/data.ts. Legacy JSON under data/ should be treated as migration input, not the main authoring format.
Create a new file in the matching content collection.
Example blog post:
---
id: post-new
title: Tieu de bai viet
slug: tieu-de-bai-viet
excerpt: Mo ta ngan
featured_image: uploads/example.jpg
type: post
reading_time: 8
view_count: 0
published_at: 2026-03-27T00:00:00.000000Z
created_at: 2026-03-27T00:00:00.000000Z
author:
id: admin
name: xDev
avatar: avatars/example.jpg
category:
id: devops
name: DevOps
slug: devops
tags:
- name: PostgreSQL
slug: postgresql
comments_count: 0
---
## Noi dung bai viet
Ban co the viet Markdown thong thuong.
- Danh sach
- Code block
- Table
Hoac chen HTML neu can.Notes:
- Keep frontmatter shape compatible with existing files already generated in
content/. slugmust match the file name.- Body content can be Markdown and inline HTML.
- Images using old Laravel-style paths such as
uploads/...are mapped to local mirrored assets inpublic/storage/uploads/.
Convert legacy JSON content into Markdown:
npm run migrate:mdDefault behavior is non-destructive: existing Markdown files are not overwritten.
If you explicitly want to regenerate Markdown from JSON and overwrite current files:
npm run migrate:md:forcesrc/lib/data.ts: content loading and lesson fallback logicsrc/lib/content.ts: MDX file reading and Markdown-to-HTML renderingscripts/migrate-json-to-md.mjs: one-time JSON to Markdown migration utilitymdx-components.tsx: required MDX integration hook for Next.js App Router