Skip to content

apply-permalinks.ts#

View Markdown

Source

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

5 symbols 3 functions 1 interfaces 1 modules 15 parameters 3 members 3 returns

Reference#

moduleapply-permalinksApplies resolved permalinks / cascade to SSG pages and collection entries.

Applies resolved permalinks / cascade to SSG pages and collection entries.

View source

fnapplyCollectionRoutes(manifest: CollectionManifest, permalinks?: ResolvedPermalinksOptions | null, cascade?: ResolvedCascadeOptions | null): { manifest: CollectionManifest; errors: string[] }Rewrites collection path / stem / inherited frontmatter.

Rewrites collection path / stem / inherited frontmatter.

Signature

export function applyCollectionRoutes(manifest: CollectionManifest, permalinks?: ResolvedPermalinksOptions | null, cascade?: ResolvedCascadeOptions | null): { manifest: CollectionManifest; errors: string[] }

View source

Parameters

Returns

object
errors
errors: string[];
manifest
manifest: CollectionManifest;
fnapplySsgPageRoutes(input: { pages: readonly SsgRoutablePage[]; permalinks?: ResolvedPermalinksOptions | null; cascade?: ResolvedCascadeOptions | null; srcDir: string; outDir: string; base: string; extension: string; siteUrl?: string; }): { pages: SsgRoutablePage[]; errors: string[] }Rewrites SSG routePaths from resolved permalinks / slugs.

Rewrites SSG routePaths from resolved permalinks / slugs.

Signature

export function applySsgPageRoutes(input: {
  pages: readonly SsgRoutablePage[];
  permalinks?: ResolvedPermalinksOptions | null;
  cascade?: ResolvedCascadeOptions | null;
  srcDir: string;
  outDir: string;
  base: string;
  extension: string;
  siteUrl?: string;
}): { pages: SsgRoutablePage[]; errors: string[] }

View source

Parameters

Returns

object
errors
errors: string[];
pages
pages: SsgRoutablePage[];
fnremapNavGroups<T extends NavGroup>(nav: T[], kept: readonly { fileUrl: string; urlPath: string; href: string }[], skippedFileUrls: readonly string[]): T[]Updates auto-nav hrefs after permalinks change a page URL.

Updates auto-nav hrefs after permalinks change a page URL.

Signature

export function remapNavGroups<T extends NavGroup>(nav: T[], kept: readonly { fileUrl: string; urlPath: string; href: string }[], skippedFileUrls: readonly string[]): T[]

View source

Parameters

  • nav T[]
  • kept readonly { fileUrl: string; urlPath: string; href: string }[]
  • skippedFileUrls readonly string[]

Returns

T[]
interfaceSsgRoutablePageSSG page shape that can have its routePaths rewritten.

SSG page shape that can have its routePaths rewritten.

Signature

export interface SsgRoutablePage

View source

Members

Properties
NameTypeDescription
frontmatter Record<string, unknown>
inputPath string
routePaths { outputPath: string; urlPath: string; href: string; ogImagePath: string; ogImageUrl: string }