Skip to content

ThemeParts

type ThemeParts =
    {
        Head: PartContext -> HeadModel -> ReactElement list
        Navbar: PartContext -> NavbarModel -> ReactElement
        Sidebar: PartContext -> SidebarModel -> ReactElement
        Toc: PartContext -> TocModel -> ReactElement
        PageNav: PartContext -> PageNavModel -> ReactElement
        EditLink: PartContext -> EditLinkModel -> ReactElement
        Article: PartContext -> ArticleSlots -> ReactElement
        Footer: PartContext -> ReactElement
        Frame: PartContext -> FrameSlots -> ReactElement
    }
AssemblyNacara.Theme.Default

What renders each part of a page. Replace one to change that part and keep the rest.

Each is given the model the theme resolved, so a replacement draws the same navbar, menu or table of contents in markup of its own. Wrap a default to add to it: call Parts.navbar from your own function and put yours around it.

Fields

Head: PartContext -> HeadModel -> ReactElement list

The tags of the head: title, description, social cards, favicon.

Navbar: PartContext -> NavbarModel -> ReactElement
Sidebar: PartContext -> SidebarModel -> ReactElement
Toc: PartContext -> TocModel -> ReactElement
PageNav: PartContext -> PageNavModel -> ReactElement
EditLink: PartContext -> EditLinkModel -> ReactElement
Article: PartContext -> ArticleSlots -> ReactElement

The <main>: title, content, and what follows it.

Footer: PartContext -> ReactElement
Frame: PartContext -> FrameSlots -> ReactElement

Arranges the pieces: navbar, then sidebar, main and table of contents, then footer.