Documentation
¶
Overview ¶
Package model provides the verless domain entities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrMessageAnyRouteError = "route '%v': %w" ErrWrongRouteFormat = errors.New("the route has an invalid format") ErrChildNodeDoesNotExist = errors.New("child node does not exist") )
Functions ¶
This section is empty.
Types ¶
type IndexPage ¶
IndexPage represents an overview page that is generated for each content sub-directory.
type Node ¶ added in v0.1.7
Node represents an URL like /blog that contains multiple pages, an overview page (IndexPage) and child routes.
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
Type *Type
Template string
// contains filtered or unexported fields
}
Page represents a sub-page of the website.
func (*Page) AddProvidedRelated ¶ added in v0.2.0
AddProvidedRelated adds a new Fully Qualified Name URI to the page.
func (*Page) ProvidedRelated ¶ added in v0.2.0
ProvidedRelated returns all Fully Qualified Name URIs related to the page.
func (*Page) ProvidedType ¶ added in v0.2.0
ProvidedType returns the user-provided page type.
func (*Page) SetProvidedType ¶ added in v0.2.0
SetProvidedType sets the user-provided page type.
type Site ¶
Site represents the actual website. The site model is generated and populated with data and content during the website build.
Any build.Writer implementation is capable of rendering this model as a static website.
func (*Site) CreateNode ¶ added in v0.1.7
CreateNode creates a new node in the route tree. The route has to start with a slash representing the root route, e. g. /blog. Returns the error ErrMessageWrongRouteFormat if the given route has a invalid format. This is the case when the route does not start with a '/'.
func (*Site) ResolveNode ¶ added in v0.1.7
ResolveNode resolves and returns a route in the route tree. Has to start with a slash representing the root route. Returns the error ErrMessageWrongRouteFormat if the given route has a invalid format. This is the case when the route does not start with a '/'.