taxonomies.ts#
7 documented symbols. Read the signatures first, then expand each item for parameters, return types, and examples.
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>Parameters
-
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[] } -
input.generatedPagesArray<{ inputPath: string; outputPath: string; html: string }> -
input.listedPagesreadonly TaxonomySourcePage[] -
input.options?ResolvedTaxonomiesOptionsoptional
-
input.outDirstring -
input.basestring -
input.render(page: TaxonomyGeneratedPage) => Promise<string> -
input.errorsstring[]
Returns
Promise<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): ResolvedTaxonomiesOptionsParameters
-
valueboolean | TaxonomiesOptions | undefined
Returns
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.
interfaceTaxonomyGeneratedPageSynthetic page passed back to generateHtmlPage.
Synthetic page passed back to generateHtmlPage.
Signature
export interface TaxonomyGeneratedPageMembers
Properties
| Name | Type | Description |
|---|---|---|
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 | undefinedParameters
-
termstring
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: [];
}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;