Components
module Components| Assembly | Nacara.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
editLink<'FrontMatter> (options: ThemeOptions) (context: PageContext<'FrontMatter>) : ReactElementLink back to the source of the page in its repository.
| Parameter | |
|---|---|
options | The theme's configuration; nothing is rendered unless EditUrlBase says where the repository is. |
context | The page being rendered, and the site around it. |
sectionOf (page: Page) : string
sectionOf (page: Page) : stringThe first segment of a route, which is what this theme calls a section.
| Parameter | |
|---|---|
page | The page to place. Its section decides which navbar entry lights up and which sidebar it is shown. |
sectionPages<'FrontMatter> (context: PageContext<'FrontMatter>) : Page list
sectionPages<'FrontMatter> (context: PageContext<'FrontMatter>) : Page listPages of the current section, in menu order.
| Parameter | |
|---|---|
context | The page being rendered, and the site around it. |
sidebar<'FrontMatter> (options: ThemeOptions) (doc: DocPage) (context: PageContext<'FrontMatter>) : ReactElement
sidebar<'FrontMatter> (options: ThemeOptions) (doc: DocPage) (context: PageContext<'FrontMatter>) : ReactElementThe 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 | |
|---|---|
options | The theme's configuration, whose Menus this renders. A section with no menu declared falls back to its pages in their own order. |
doc | What the page asked for: whether the menu offers a filter, and whether it remembers folding across pages. |
context | The page being rendered, and the site around it. |
toc<'FrontMatter> (context: PageContext<'FrontMatter>) : ReactElement
toc<'FrontMatter> (context: PageContext<'FrontMatter>) : ReactElementThe headings of this page, in the right-hand column.
| Parameter | |
|---|---|
context | The page being rendered, and the site around it. |
translationsOf (site: SiteInfo) (pages: Page list) (page: Page) : (Locale * string * bool) list
translationsOf (site: SiteInfo) (pages: Page list) (page: Page) : (Locale * string * bool) listTranslations 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 | |
|---|---|
site | The site's locales and where it is served from. |
pages | Every page of the build, which is where a translation is looked for. |
page | The page being rendered. |