Functions
- Functions by entry point - (Outline, Contents)
- createIndicators - (Outline, Contents)
- generateStaticParams - (Outline, Contents)
- read - (Outline, Contents)
- layout and page - (Outline, Contents)
- encode and decode - (Outline, Contents)
- href, splitLocale, negotiate - (Outline, Contents)
- Helpers - (Outline, Contents)
- withFairGardenIndicators - (Outline, Contents)
- createNavigation - (Outline, Contents)
- createLocaleProxy - (Outline, Contents)
Functions by entry point
The functions each of the package's four entry points exports.
Outline
- Sections:
@fairgarden/indicators@fairgarden/indicators/withFairGardenIndicators@fairgarden/indicators/link@fairgarden/indicators/proxy
createIndicators
Declare what goes into the path.
Outline
- Sections:
- Config
- An indicator
- The result
- Types
generateStaticParams
The variants to prerender, ready to export from a layout or page.
Outline
- Sections:
- What a segment list holds
read
What a route's params name.
Outline
- Sections:
- Not found
- Notes
layout and page
read as a wrapper.
Outline
- Sections:
- Notes
encode and decode
The segment encoding, for an app that spells a segment
itself: a custom generateStaticParams, a route directory that switches on
a flag, a test.
href, splitLocale, negotiate
Locale-aware paths without React, for server code.
Outline
- Sections:
hrefsplitLocalenegotiate
Helpers
The pieces createIndicators is built from, exported for tests and tooling.
Outline
- Sections:
- Negotiation
- Paths
- Routes
- Constants
withFairGardenIndicators
Adds the rewrites, the redirects, the headers of the
stylesheet indicators, and Accept-CH for the
client hints they read.
Outline
- Sections:
- Options
- Hard flags
- What it detects
- Why a separate entry point
- In a monolith
createNavigation
Links and hooks that know which locale the page is in.
Outline
- Sections:
- Options
LinkuseHrefuseSetLocaleuseIndicatorsanduseLocaleusePref- Notes
createLocaleProxy
A proxy.ts that negotiates the locale at the site root, and matches
nothing else.
Outline
- Sections:
- What it does at the root
- Mounted
- Notes