Skip to content

taxonomies.ts#

View Markdown

Source

7 documented symbols. Read the signatures first, then expand each item for parameters, return types, and examples.

7 symbols 5 functions 1 interfaces 1 modules 14 parameters 5 members 5 returns

Reference#

fnappendTaxonomyPages(input: { generatedPages: Array<{ inputPath: string; outputPath: string; html: string }>; listedPages: readonly TaxonomySourcePage[]; options?: ResolvedTaxonomiesOptions; outDir: string; base: string; render: (page: TaxonomyGeneratedPage) => Promise<string>; errors: string[]; }): Promise<void>Renders themed list and per-term pages and appends them to the build.

Renders themed list and per-term pages and appends them to the build.

Signature

export async function appendTaxonomyPages(input: {
  generatedPages: Array<{ inputPath: string; outputPath: string; html: string }>;
  listedPages: readonly TaxonomySourcePage[];
  options?: ResolvedTaxonomiesOptions;
  outDir: string;
  base: string;
  render: (page: TaxonomyGeneratedPage) => Promise<string>;
  errors: string[];
}): Promise<void>

View source

Parameters

Returns

Promise<void>
fninjectRelatedPages(pages: TaxonomySourcePage[], listed: readonly TaxonomySourcePage[], options?: ResolvedTaxonomiesOptions): voidAppends related-page HTML to source pages that share a listed term.

Appends related-page HTML to source pages that share a listed term.

Signature

export function injectRelatedPages(pages: TaxonomySourcePage[], listed: readonly TaxonomySourcePage[], options?: ResolvedTaxonomiesOptions): void

View source

Parameters

Returns

void
fnresolveTaxonomiesOptions(value: boolean | TaxonomiesOptions | undefined): ResolvedTaxonomiesOptionsResolves taxonomies with defaults. false / omitted stays off. true enables tags…

Resolves taxonomies with defaults.

false / omitted stays off. true enables tags and categories with relatedLimit 5. An object enables the feature and overrides only set fields.

Signature

export function resolveTaxonomiesOptions(value: boolean | TaxonomiesOptions | undefined): ResolvedTaxonomiesOptions

View source

Parameters

Returns

ResolvedTaxonomiesOptions
moduletaxonomiesOpt-in taxonomy term pages and related-page lists. Resolution and HTML live here. The Vite plugin injects related marku…

Opt-in taxonomy term pages and related-page lists.

Resolution and HTML live here. The Vite plugin injects related markup into page content, then writes themed list and per-term pages during SSG.

View source

interfaceTaxonomyGeneratedPageSynthetic page passed back to generateHtmlPage.

Synthetic page passed back to generateHtmlPage.

Signature

export interface TaxonomyGeneratedPage

View source

Members

Properties
NameTypeDescription
content string
href string
outputPath string
title string
urlPath string
fntermSlug(term: string): string | undefinedStable URL slug for a frontmatter term. Returns undefined when the value cannot…

Stable URL slug for a frontmatter term.

Returns undefined when the value cannot become a safe [a-z0-9-] href.

Signature

export function termSlug(term: string): string | undefined

View source

Parameters

  • term string

Returns

string | undefined
fntoTaxonomyProcessResult(page: TaxonomyGeneratedPage): { inputPath: string; routePaths: { outputPath: string; urlPath: string; href: string; ogImagePath: string; ogImageUrl: string; }; transformedHtml: string; title: string; frontmatter: Record<string, unknown>; toc: []; }Maps a generated taxonomy page onto the SSG render shape.

Maps a generated taxonomy page onto the SSG render shape.

Signature

export function toTaxonomyProcessResult(page: TaxonomyGeneratedPage): {
  inputPath: string;
  routePaths: {
    outputPath: string;
    urlPath: string;
    href: string;
    ogImagePath: string;
    ogImageUrl: string;
  };
  transformedHtml: string;
  title: string;
  frontmatter: Record<string, unknown>;
  toc: [];
}

View source

Parameters

Returns

object
frontmatter
frontmatter: Record<string, unknown>;
inputPath
inputPath: string;
routePaths
routePaths: { outputPath: string; urlPath: string; href: string; ogImagePath: string; ogImageUrl: string };
title
title: string;
toc
toc: [];
transformedHtml
transformedHtml: string;