Skip to content

locale-nav.ts#

View Markdown

Source

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

4 symbols 3 functions 1 modules 5 parameters 3 returns

Reference#

modulelocale-navRewrites default-theme nav hrefs to the current locale sibling when it exists.

Rewrites default-theme nav hrefs to the current locale sibling when it exists.

View source

fnlocaleHomeHref(options: LocalizeNavOptions): stringHome href for the header logo. Uses the same sibling lookup as header nav, and…

Home href for the header logo. Uses the same sibling lookup as header nav, and leaves the default locale unprefixed when hideDefaultLocale is set.

Signature

export function localeHomeHref(options: LocalizeNavOptions): string

View source

Parameters

  • options LocalizeNavOptions

Returns

string
fnlocalizeHeaderNavItems(items: HeaderNavItem[] | undefined, options: LocalizeNavOptions): HeaderNavItem[] | undefinedResolves header labels and rewrites link values the same way as the sidebar.

Resolves header labels and rewrites link values the same way as the sidebar.

Signature

export function localizeHeaderNavItems(items: HeaderNavItem[] | undefined, options: LocalizeNavOptions): HeaderNavItem[] | undefined

View source

Parameters

Returns

HeaderNavItem[] | undefined
fnlocalizeNavGroups<T extends LocalizableNavGroup>(groups: T[], options: LocalizeNavOptions): T[]Resolves authored sidebar label maps and prefixes hrefs/paths with the current…

Resolves authored sidebar label maps and prefixes hrefs/paths with the current locale when that page exists. Missing siblings stay as authored.

Signature

export function localizeNavGroups<T extends LocalizableNavGroup>(groups: T[], options: LocalizeNavOptions): T[]

View source

Parameters

  • groups T[]
  • options LocalizeNavOptions

Returns

T[]