Takazudo Modular Docs

Type to search...

to open search from anywhere

Guide Series

Guide series data structure and computed dates

Guide Series

Guide series group related guide articles into ordered collections. Series metadata is defined in src/data/guide-series.mjs with TypeScript types in src/data/guide-series.d.mts.

Data Source

  • Static data: src/data/guide-series.mjs
  • Type definition: src/data/guide-series.d.mts
  • Data functions: lib/articles/get-guide-articles.ts

GuideSeries Type

export interface GuideSeries {
  slug: string;
  name: string;
  description: string;
  thumbSlug: string;
  articleSlugs: string[];
  createdDate?: string;
  updatedDate?: string | null;
}

Fields

  • slug: URL-safe identifier (e.g., power, diy, how-to-build)
  • name: Japanese display name
  • description: Short Japanese description
  • thumbSlug: Image slug used for the series thumbnail
  • articleSlugs: Ordered array of article slugs belonging to the series
  • createdDate: Computed from the earliest createdAt among the series’ articles (YYYY-MM-DD format)
  • updatedDate: Computed from the latest activity date across the series’ articles. Set to null if it equals createdDate

Computed Dates

The createdDate and updatedDate fields are not stored in the static data file. They are computed at build time by getGuideSeriesWithDates() in lib/articles/get-guide-articles.ts.

  • createdDate: The earliest createdAt (or date) value from all articles in the series
  • updatedDate: The latest date across all articles’ createdAt and updatedAt fields. Only set when it differs from createdDate

Functions

getGuideSeriesWithDates

Returns all guide series enriched with computed date fields.

import { getGuideSeriesWithDates } from '@/lib/articles/get-guide-articles';

const seriesWithDates = await getGuideSeriesWithDates();

getSeriesBySlug

Returns a single series by its slug (without computed dates).

import { getSeriesBySlug } from '@/src/data/guide-series.mjs';

const series = getSeriesBySlug('power');

Display Format

Dates are displayed in series list items using the format:

  • With both dates: 作成: 2025/03/15 | 更新: 2025/03/30
  • With creation date only: 作成: 2025/03/15