logo hsb.horse

Architecture Decision Record

Blog content collection design

Define the schema and operating rules for managing blog posts in Markdown/MDX.

Accepted #blog #content #architecture

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, default false)
    • tags (optional, string[])
    • image (optional, string)
    • noindex (optional, boolean, default false)
    • lang (optional, string, default ja)
    • 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 + slug combination. Use the same slug across translations.
  • Sort lists by publishedAt and use updatedAt for “last updated” display.
  • Treat draft as the flag for excluding posts from listings/feeds/build targets.
  • Treat noindex as 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 lang and slug fields maintain consistent URLs aligned with the i18n strategy.

Consequences

  • All blog posts must follow the schema above.
  • Operational rules for draft and noindex need to be shared as publication criteria.
  • Adding languages requires creating translations with matching slug values.