Skip to content

not-found.ts#

View Markdown

Source

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

8 symbols 6 functions 1 variables 1 modules 10 parameters 6 returns

Reference#

variableconst FALLBACK_NOT_FOUND_MARKDOWN = `--- title: ${FALLBACK_NOT_FOUND_TITLE} --- # ${FALLBACK_NOT_FOUND_TITLE} The page you requested does not exist. Use search or the navigation to find what you need. `Built-in Markdown used when the configured source file is missing.

Built-in Markdown used when the configured source file is missing.

Signature

export const FALLBACK_NOT_FOUND_MARKDOWN = `---
title: ${FALLBACK_NOT_FOUND_TITLE}
---

# ${FALLBACK_NOT_FOUND_TITLE}

The page you requested does not exist. Use search or the navigation to find what you need.
`

View source

fnisNotFoundSourceFile(filePath: string, srcDir: string, options?: ResolvedNotFoundOptions): booleanTrue when filePath is the enabled not-found source.

True when filePath is the enabled not-found source.

Signature

export function isNotFoundSourceFile(filePath: string, srcDir: string, options?: ResolvedNotFoundOptions): boolean

View source

Parameters

Returns

boolean
modulenot-foundOpt-in custom 404 page helpers. Resolution and path rules live here. The Vite plugin writes the themed HTML during SSG…

Opt-in custom 404 page helpers.

Resolution and path rules live here. The Vite plugin writes the themed HTML during SSG and omits the page from the search index and sitemap.

View source

fnnotFoundSearchDocumentId(source: string): stringSearch document id for a not-found source path.

Search document id for a not-found source path.

Signature

export function notFoundSearchDocumentId(source: string): string

View source

Parameters

  • source string

Returns

string
fnnotFoundSearchExcludeIds(options?: ResolvedNotFoundOptions): string[]Search document ids that must not be indexed when the feature is on.

Search document ids that must not be indexed when the feature is on.

Signature

export function notFoundSearchExcludeIds(options?: ResolvedNotFoundOptions): string[]

View source

Parameters

Returns

string[]
fnresolveNotFoundOptions(value: boolean | NotFoundOptions | undefined): ResolvedNotFoundOptionsResolves ssg.notFound with defaults. false / omitted stays off. true enables 40…

Resolves ssg.notFound with defaults.

false / omitted stays off. true enables 404.md404.html. An object enables the feature and overrides only the fields the site set.

Signature

export function resolveNotFoundOptions(value: boolean | NotFoundOptions | undefined): ResolvedNotFoundOptions

View source

Parameters

Returns

ResolvedNotFoundOptions
fnresolveNotFoundOutputPath(outDir: string, output: string): stringAbsolute output path, confined to outDir.

Absolute output path, confined to outDir.

Signature

export function resolveNotFoundOutputPath(outDir: string, output: string): string

View source

Parameters

  • outDir string
  • output string

Returns

string
fnresolveNotFoundSourcePath(srcDir: string, source: string): stringAbsolute source path, confined to srcDir.

Absolute source path, confined to srcDir.

Signature

export function resolveNotFoundSourcePath(srcDir: string, source: string): string

View source

Parameters

  • srcDir string
  • source string

Returns

string