Skip to content

DocFrontMatter

type DocFrontMatter =
    {
        Title: string
        Description: string option
        Order: int option
        Layout: string option
        PageNav: bool option
        MenuFilter: bool option
        MenuMemory: bool option
        Toc: TocSetting option
        Main: (string * string) list
    }
AssemblyNacara.Theme.Default

Front matter understood by the theme's ready-made collection.

The shape of every page's --- block. A site wanting fields of its own declares its own record and its own decoder; this one is what Theme.docs reads, and the only required field is the title.

Fields

Title: string

The page's title: its heading, its entry in the menu, and what search shows.

Description: string option

One sentence about the page, for search results and the page's meta description.

Order: int option

Where the page sits among the pages of its section.

Read only when the section has no menu declared - a menu says the order outright, and then this says nothing. Pages without one come last, in title order.

Layout: string option

Which layout renders the page, when it is not the ordinary one.

layout: bare is a page with no chrome: no menu, no table of contents, no previous and next links. A landing page is the usual reason.

PageNav: bool option

Whether this page offers the previous and next pages of its section.

pageNav: false for a page that is not part of a sequence - a landing page, or one of a set a reader arrives at by name rather than by reading through.

MenuFilter: bool option

Whether a box for filtering the section's menu is offered.

Left out, the theme decides: a menu long enough that finding a name means opening folds gets one, a menu you can read at a glance does not. menuFilter: true asks for one regardless, menuFilter: false refuses it.

MenuMemory: bool option

Whether the menu carries a reader's folding over to the next page.

menuMemory: false for a section read by name rather than in order - a reference - where every page opens the menu the same way: the trail to itself, and nothing else.

Toc: TocSetting option

The table of contents: toc: false for none, or the heading levels it holds.

toc:
from: 2
to: 2

A page whose sections are uninteresting on their own - a changelog, where the versions are what a reader navigates by - says so here. Left out, the markdown plugin's option decides for the whole site. Either bound may be left out: from is 2, a page's own title being the only heading above it, and to is 6.

Main: (string * string) list

Attributes to put on the page's <main>:

main:
data-pagefind-weight: "0.3"

id, class and tabindex are the theme's own and cannot be set here.

Functions and values

decoder: Decoder<DocFrontMatter>

Reads the theme's front matter, failing the build with file and line when it cannot.

toDocPage (frontMatter: DocFrontMatter) : DocPage

The theme's view of a page described by this front matter.