Skip to content

section-index.ts#

View Markdown

Source

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

6 symbols 3 functions 2 interfaces 1 modules 12 parameters 10 members 3 returns

Reference#

fnappendSectionIndexPages(input: { generatedPages: Array<{ inputPath: string; outputPath: string; html: string }>; collectedPages: readonly SectionIndexSourcePage[]; listedPages: readonly SectionIndexSourcePage[]; options?: ResolvedSectionIndexOptions; outDir: string; base: string; extension: string; errors: string[]; render: (page: SectionIndexGeneratedPage) => Promise<string>; }): Promise<void>Appends generated section indexes for directories that have no real index.

Appends generated section indexes for directories that have no real index.

Signature

export async function appendSectionIndexPages(input: {
  generatedPages: Array<{ inputPath: string; outputPath: string; html: string }>;
  collectedPages: readonly SectionIndexSourcePage[];
  listedPages: readonly SectionIndexSourcePage[];
  options?: ResolvedSectionIndexOptions;
  outDir: string;
  base: string;
  extension: string;
  errors: string[];
  render: (page: SectionIndexGeneratedPage) => Promise<string>;
}): Promise<void>

View source

Parameters

Returns

Promise<void>
fnresolveSectionIndexOptions(value: boolean | SectionIndexOptions | undefined): ResolvedSectionIndexOptionsResolves ssg.sectionIndex with defaults. false / omitted stays off. true enable…

Resolves ssg.sectionIndex with defaults.

false / omitted stays off. true enables card listings. An object enables the feature and overrides only the fields the site set.

Signature

export function resolveSectionIndexOptions(value: boolean | SectionIndexOptions | undefined): ResolvedSectionIndexOptions

View source

Parameters

Returns

ResolvedSectionIndexOptions
modulesection-indexOpt-in generated section index pages. Resolution and directory walking live here. Listing HTML is rendered in Rust (ox_…

Opt-in generated section index pages.

Resolution and directory walking live here. Listing HTML is rendered in Rust (ox_content_ssg::render_section_index) when the NAPI helper is available; a matching TypeScript renderer covers the same escape / href rules so the SSG path stays safe either way. The Vite plugin appends themed HTML during SSG and never overwrites an existing index page.

View source

interfaceSectionIndexGeneratedPageSynthetic page passed back to generateHtmlPage.

Synthetic page passed back to generateHtmlPage.

Signature

export interface SectionIndexGeneratedPage

View source

Members

Properties
NameTypeDescription
content string
href string
outputPath string
title string
urlPath string
interfaceSectionIndexSourcePageOne built page considered when deciding indexes and children.

One built page considered when deciding indexes and children.

Signature

export interface SectionIndexSourcePage

View source

Members

Properties
NameTypeDescription
descriptionoptional string
frontmatter Record<string, unknown>
inputPathoptional string
routePaths { href: string; urlPath: string; outputPath?: string }
title string
fntoSectionIndexProcessResult(page: SectionIndexGeneratedPage): { 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 section index onto the SSG render shape.

Maps a generated section index onto the SSG render shape.

Signature

export function toSectionIndexProcessResult(page: SectionIndexGeneratedPage): {
  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;