Skip to content

Components

module Components
AssemblyNacara.Theme.Default
Attributes[<RequireQualifiedAccess>]

The building blocks of the default theme.

Exposed one by one, so a layout of your own can keep the navbar and the sidebar and replace only what it needs to.

Functions and values

editLink<'FrontMatter> (options: ThemeOptions) (context: PageContext<'FrontMatter>) : ReactElement

Link back to the source of the page in its repository.

Parameter
optionsThe theme's configuration; nothing is rendered unless EditUrlBase says where the repository is.
contextThe page being rendered, and the site around it.
navbar<'FrontMatter> (options: ThemeOptions) (context: PageContext<'FrontMatter>) : ReactElement

The bar across the top: brand, sections, and whatever sits at its end.

Parameter
optionsThe theme's configuration, whose Navbar and NavbarEnd this renders.
contextThe page being rendered, and the site around it.
pageNav<'FrontMatter> (options: ThemeOptions) (context: PageContext<'FrontMatter>) : ReactElement

Previous and next links, following the order of the sidebar.

Parameter
optionsThe theme's configuration, read for the menu that decides what comes before and after.
contextThe page being rendered, and the site around it.
sectionOf (page: Page) : string

The first segment of a route, which is what this theme calls a section.

Parameter
pageThe page to place. Its section decides which navbar entry lights up and which sidebar it is shown.
sectionPages<'FrontMatter> (context: PageContext<'FrontMatter>) : Page list

Pages of the current section, in menu order.

Parameter
contextThe page being rendered, and the site around it.
sidebar<'FrontMatter> (options: ThemeOptions) (doc: DocPage) (context: PageContext<'FrontMatter>) : ReactElement

The sidebar of the current section.

An explicit menu wins; otherwise the section's own pages are listed in front-matter order.

Rendered even when a page asks for no menu: it is also the drawer the navbar's sections fold into on a narrow screen.

Parameter
optionsThe theme's configuration, whose Menus this renders. A section with no menu declared falls back to its pages in their own order.
docWhat the page asked for: whether the menu offers a filter, and whether it remembers folding across pages.
contextThe page being rendered, and the site around it.
toc<'FrontMatter> (context: PageContext<'FrontMatter>) : ReactElement

The headings of this page, in the right-hand column.

Parameter
contextThe page being rendered, and the site around it.
translationsOf (site: SiteInfo) (pages: Page list) (page: Page) : (Locale * string * bool) list

Translations of a page, one per locale that has one.

Pages are paired by their locale-independent route key, so a translation is found even though its file lives in another directory - and a locale with no translation of this page still appears, pointing at its home page rather than at a 404.

Parameter
siteThe site's locales and where it is served from.
pagesEvery page of the build, which is where a translation is looked for.
pageThe page being rendered.