section-index.ts#
6 documented symbols. Read the signatures first, then expand each item for parameters, return types, and examples.
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>Parameters
-
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> } -
input.generatedPagesArray<{ inputPath: string; outputPath: string; html: string }> -
input.collectedPagesreadonly SectionIndexSourcePage[] -
input.listedPagesreadonly SectionIndexSourcePage[] -
input.options?ResolvedSectionIndexOptionsoptional
-
input.outDirstring -
input.basestring -
input.extensionstring -
input.errorsstring[] -
input.render(page: SectionIndexGeneratedPage) => Promise<string>
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): ResolvedSectionIndexOptionsParameters
-
valueboolean | SectionIndexOptions | undefined
Returns
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.
interfaceSectionIndexGeneratedPageSynthetic page passed back to generateHtmlPage.
Synthetic page passed back to generateHtmlPage.
Signature
export interface SectionIndexGeneratedPageMembers
Properties
| Name | Type | Description |
|---|---|---|
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 SectionIndexSourcePageMembers
Properties
| Name | Type | Description |
|---|---|---|
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: [];
}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;