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
createdAtamong the series’ articles (YYYY-MM-DD format) - updatedDate: Computed from the latest activity date across the series’ articles. Set to
nullif it equalscreatedDate
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(ordate) value from all articles in the series - updatedDate: The latest date across all articles’
createdAtandupdatedAtfields. Only set when it differs fromcreatedDate
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