Documentation
¶
Overview ¶
Package shell is the docs-shell registry block (REQ-CNT-06): a layout with a header, a sidebar, a table of contents, pagination and a 404, plus the client behaviours they need.
Index ¶
- Variables
- func Active(path string, href string) bool
- func ActiveItem(path string, item NavItem) bool
- func Header(p HeaderProps) gx.Node
- func NotFound(p NotFoundProps) gx.Node
- func PageMeta(p PageMetaProps) gx.Node
- func Pagination(p PaginationProps) gx.Node
- func SearchDialog(p SearchDialogProps) gx.Node
- func Shell(p ShellProps) gx.Node
- func Sidebar(p SidebarProps) gx.Node
- func SidebarGroup(p SidebarGroupProps) gx.Node
- func SidebarItem(p SidebarItemProps) gx.Node
- func Splash(p SplashProps) gx.Node
- func ThemeSelect(p ThemeSelectProps) gx.Node
- func Toc(p TocProps) gx.Node
- type Config
- type HeaderProps
- type Heading
- type Link
- type Nav
- type NavGroup
- type NavItem
- type NotFoundProps
- type Page
- type PageMetaProps
- type PaginationProps
- type SearchDialogProps
- type ShellProps
- type SidebarGroupProps
- type SidebarItemProps
- type SidebarProps
- type SplashProps
- type ThemeSelectProps
- type TocProps
Constants ¶
This section is empty.
Variables ¶
var HeaderFixtures = gx.Fixtures[HeaderProps]{
"Default": {Site: fixtureSite},
}
var NotFoundFixtures = gx.Fixtures[NotFoundProps]{
"Default": {},
}
var PageMetaFixtures = gx.Fixtures[PageMetaProps]{ "Default": {Site: fixtureSite, Page: fixturePage}, "Plain": {Site: Config{Title: "Site"}, Page: Page{Title: "Page", Path: "/page/"}}, }
var PaginationFixtures = gx.Fixtures[PaginationProps]{ "Both": {Prev: &NavItem{Label: "Start", Href: gx.URL("/start/")}, Next: fixtureNext}, "Next": {Next: fixtureNext}, "Empty": {}, }
var SearchDialogFixtures = gx.Fixtures[SearchDialogProps]{
"Default": {},
}
var ShellFixtures = gx.Fixtures[ShellProps]{ "Default": {Site: fixtureSite, Nav: fixtureNav, Page: fixturePage, Children: gx.Text("Body.")}, }
var SidebarFixtures = gx.Fixtures[SidebarProps]{
"Default": {Nav: fixtureNav, Path: "/guides/routing/pages/"},
}
var SidebarGroupFixtures = gx.Fixtures[SidebarGroupProps]{
"Default": {Group: fixtureStart, Path: "/start/"},
"Nested": {Group: fixtureGuides, Path: "/guides/routing/pages/"},
}
var SidebarItemFixtures = gx.Fixtures[SidebarItemProps]{ "Link": {Item: NavItem{Label: "Routing", Href: gx.URL("/guides/routing/")}, Path: "/guides/routing/"}, "Nested": {Item: fixtureRouting, Path: "/guides/routing/pages/"}, }
var SplashFixtures = gx.Fixtures[SplashProps]{ "Default": {Title: "Deedbox", Tagline: "Event sourcing in .NET.", Actions: gx.Text("Docs")}, "Plain": {Title: "Deedbox"}, }
var ThemeSelectFixtures = gx.Fixtures[ThemeSelectProps]{
"Default": {},
}
var TocFixtures = gx.Fixtures[TocProps]{
"Default": {Headings: fixtureHeadings},
}
Functions ¶
func Active ¶
Active reports whether href is the current page or a parent of it (REQ-CNT-06). The sidebar marks active items on the server.
func ActiveItem ¶
ActiveItem reports whether any descendant of item is active.
func Header ¶
func Header(p HeaderProps) gx.Node
func NotFound ¶
func NotFound(p NotFoundProps) gx.Node
func PageMeta ¶
func PageMeta(p PageMetaProps) gx.Node
func Pagination ¶
func Pagination(p PaginationProps) gx.Node
func SearchDialog ¶
func SearchDialog(p SearchDialogProps) gx.Node
func Shell ¶
func Shell(p ShellProps) gx.Node
func Sidebar ¶
func Sidebar(p SidebarProps) gx.Node
func SidebarGroup ¶
func SidebarGroup(p SidebarGroupProps) gx.Node
func SidebarItem ¶
func SidebarItem(p SidebarItemProps) gx.Node
func Splash ¶
func Splash(p SplashProps) gx.Node
func ThemeSelect ¶
func ThemeSelect(p ThemeSelectProps) gx.Node
Types ¶
type Config ¶
type Config struct {
Title string
Version string
Links []Link
// EditBase is the repository edit URL up to the file path, for example
// https://github.com/acme/site/edit/main/content/docs/. Empty hides
// the edit link.
EditBase string
}
Config is the site-wide shell data (REQ-CNT-06).
type HeaderProps ¶
type HeaderProps struct {
// Site is the site-wide data: the title, the version and the header links.
Site Config
}
type NavGroup ¶
type NavGroup struct {
}
NavGroup is one sidebar section. A group with Collapsed starts closed.
type NotFoundProps ¶
type Page ¶
type Page struct {
Title string
// Path is the site path of the page, for example /start/.
Path string
// Section is the sidebar group label of the page.
Section string
// Updated is the last-updated text. Empty hides it.
Updated string
// Prev and Next are the previous and next sidebar items.
Prev *NavItem
Next *NavItem
// TOC holds the page headings, in document order.
TOC []Heading
// Depth limits the table of contents to headings at or below this
// level. Zero means 3.
Depth int
}
Page is the shell data of one page (REQ-CNT-06).
type PageMetaProps ¶
type PaginationProps ¶
type SearchDialogProps ¶
type SearchDialogProps struct {
}
type ShellProps ¶
type SidebarGroupProps ¶
type SidebarItemProps ¶
type SidebarProps ¶
type SplashProps ¶
type SplashProps struct {
// Title is the heading of the splash.
Title string
// Tagline is the text below the title. Empty omits it.
Tagline string
// Actions is the row of links or buttons below the tagline. Nil omits it.
Actions gx.Node
// Children is the content below the actions. Nil omits it.
Children gx.Node
}
type ThemeSelectProps ¶
type ThemeSelectProps struct {
}
Source Files
¶
- Header.fixtures.go
- Header_gx.go
- NotFound.fixtures.go
- NotFound_gx.go
- PageMeta.fixtures.go
- PageMeta_gx.go
- Pagination.fixtures.go
- Pagination_gx.go
- SearchDialog.fixtures.go
- SearchDialog_gx.go
- Shell.fixtures.go
- Shell_gx.go
- Sidebar.fixtures.go
- SidebarGroup.fixtures.go
- SidebarGroup_gx.go
- SidebarItem.fixtures.go
- SidebarItem_gx.go
- Sidebar_gx.go
- Splash.fixtures.go
- Splash_gx.go
- ThemeSelect.fixtures.go
- ThemeSelect_gx.go
- Toc.fixtures.go
- Toc_gx.go
- fixtures.go
- helpers.go
- nav.go