model

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Footer struct {
	Items []FooterItem
}

type FooterItem

type FooterItem struct {
	Label  string
	Target string
}

type IndexPage

type IndexPage struct {
	Page
	Pages []*Page
}

type Meta

type Meta struct {
	Title       string
	Subtitle    string
	Description string
	Author      string
	Base        string
}
type Nav struct {
	Items []NavItem
}
type NavItem struct {
	Label  string
	Target string
}

type Page

type Page struct {
	Route       string
	ID          string
	Title       string
	Author      string
	Date        time.Time
	Tags        []string
	Img         string
	Credit      string
	Description string
	Content     string
	Related     []*Page
	Template    string
	// contains filtered or unexported fields
}

func (*Page) AddRelatedFQN

func (p *Page) AddRelatedFQN(relatedFQN string)

AddRelatedFQN adds a new FullyQuallifiedName uri to the page.

func (*Page) Hidden

func (p *Page) Hidden() bool

Hidden describes if the page should be shown (false) or hidden (true).

func (*Page) RelatedFQNs

func (p *Page) RelatedFQNs() []string

RelatedFQNs returns all FullyQuallifiedName uris related to the page.

func (*Page) SetHidden

func (p *Page) SetHidden(hidden bool)

SetHidden shows (false) or hides (true) the page.

type Route

type Route struct {
	Children  map[string]*Route
	Pages     []Page
	IndexPage IndexPage
}

type Site

type Site struct {
	Meta   Meta
	Nav    Nav
	Root   Route
	Footer Footer
}

func (*Site) CreateRoute

func (s *Site) CreateRoute(route string) *Route

func (*Site) ResolveRoute

func (s *Site) ResolveRoute(route string) (*Route, error)

func (*Site) WalkRoutes

func (s *Site) WalkRoutes(walkFn walkFn, maxDepth int) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL