Blog content collection design
Decision
- Manage blog posts as Markdown/MDX files under
/blog. - Use the following frontmatter schema:
title(required, string)description(optional, string)publishedAt(required, date)updatedAt(optional, date)draft(optional, boolean, defaultfalse)tags(optional, string[])image(optional, string)noindex(optional, boolean, defaultfalse)lang(optional, string, defaultja)slug(optional, string, derived from filename when omitted)prev(optional,true | false | string, explicitly control previous link)next(optional,true | false | string, explicitly control next link)
- Follow the i18n URL strategy by deriving URLs from the
lang+slugcombination. Use the sameslugacross translations. - Sort lists by
publishedAtand useupdatedAtfor “last updated” display. - Treat
draftas the flag for excluding posts from listings/feeds/build targets. - Treat
noindexas metadata indicating the post should be excluded from search engine indexing.
Context
A consistent schema is required to reliably generate listings, detail pages, and SEO metadata for long-term blog operations. The design must align with the i18n approach (Japanese as default, additional languages under subdirectories).
Options
- Markdown/MDX with Content Collection
- External headless CMS
- Manual JSON/TS management
Rationale
- Markdown/MDX keeps authoring and review lightweight.
- Content Collection schemas provide build-time validation.
- Explicit
langandslugfields maintain consistent URLs aligned with the i18n strategy.
Consequences
- All blog posts must follow the schema above.
- Operational rules for
draftandnoindexneed to be shared as publication criteria. - Adding languages requires creating translations with matching
slugvalues.
hsb.horse