Skip to content

Menu

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

Menu entries, built by pipeline.

Functions and values

badge (label: string) (item: MenuItem) : MenuItem

Mark an entry. The text is shown; its slug decides the colour.

Parameter
labelWhat the badge reads - New, Deprecated. Its slug is the styling hook, so New and new look alike.
itemThe entry to mark.
badgeOf (kind: string) (label: string) (item: MenuItem) : MenuItem

Mark an entry, choosing the styling hook rather than deriving it.

Parameter
kindWhat the theme styles it as, whatever the label happens to read. Badge holds the ones it has colours for.
labelWhat the badge reads.
itemThe entry to mark.
group (path: string) (items: MenuItem list) : MenuItem

A group whose label is its own page.

Parameter
pathThe overview page of what the group holds, relative to the content directory - plugins/markdown/index.md.
itemsWhat is under it. The group opens by itself when the reader is on one of them.
link (label: string) (url: string) : MenuItem

Anything outside the site.

Parameter
labelWhat the entry reads.
urlWhere it goes. Nothing resolves it against the site, so write it in full.
ofOutline (outline: MenuOutlineItem list) : MenuItem list

The menu a plugin offered, as this theme's own entries.

What a site writes for the section is used instead - an offer, not a rule.

Parameter
outlineWhat a plugin registered for the section it generates.
page (path: string) : MenuItem

A page, referenced by the path of its source file.

Parameter
pathRelative to the content directory, extension included - guide/getting-started.md. The entry takes the page's own title, so renaming a heading does not mean editing the menu.
section (label: string) (items: MenuItem list) : MenuItem

A label over a set of entries.

Parameter
labelWhat the group reads. It is a heading, not a link.
itemsWhat is under it. Nested deeper than the top level, a section folds.