not-found.ts#
8 documented symbols. Read the signatures first, then expand each item for parameters, return types, and examples.
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.
`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): booleanParameters
-
filePathstring -
srcDirstring -
optionsResolvedNotFoundOptionsoptional
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.
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): stringParameters
-
sourcestring
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[]Parameters
-
optionsResolvedNotFoundOptionsoptional
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.md → 404.html. An object enables the feature and overrides only the fields the site set.
Signature
export function resolveNotFoundOptions(value: boolean | NotFoundOptions | undefined): ResolvedNotFoundOptionsParameters
-
valueboolean | NotFoundOptions | undefined
Returns
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): stringParameters
-
outDirstring -
outputstring
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): stringParameters
-
srcDirstring -
sourcestring
Returns
string