Documentation ¶
Index ¶
- func ModifiedRoutemap(file io.Reader, templates, handlers []Missing) ([]byte, error)
- func ProcessRoutemap(tree *toml.Tree, templatePath string, bindResources bool) (routes PageRoutes, templates []Missing, handlers []Missing, err error)
- func TemplateDataForRoutes(page PageRoutes, missTpl []Missing, missHlr []Missing) (entries []generate.Entry, routes []generate.Route, ...)
- type Missing
- type PageRoutes
- type RouteView
- type TemplateBlock
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ModifiedRoutemap ¶
ModifiedRoutemap will read the lines of a routemap and insert missing content at the releveant locations
func ProcessRoutemap ¶
func ProcessRoutemap(tree *toml.Tree, templatePath string, bindResources bool) (routes PageRoutes, templates []Missing, handlers []Missing, err error)
ProcessRoutemap will unmarshal and validate a TOML routemap. This will keep track of missing template and handler values.
func TemplateDataForRoutes ¶
func TemplateDataForRoutes(page PageRoutes, missTpl []Missing, missHlr []Missing) ( entries []generate.Entry, routes []generate.Route, templates []generate.HTMLTemplate, handlers []generate.Handler, err error, )
TemplateDataForRoutes will take hierarchical definition of views and flatten to data for rendering in the templates
Types ¶
type Missing ¶
Missing is a missing value in the TOML file tree, it pairs the route view data with the position reference in the source TOML file
type PageRoutes ¶
PageRoutes is the top level view for a site page, it includes a URI and golang package namespace
type RouteView ¶
type RouteView struct { Ref string `toml:"_ref"` Default bool `toml:"_default"` Doc string `toml:"_doc"` Path string `toml:"_path"` Template string `toml:"_template"` Handler string `toml:"_handler"` Method string `toml:"_method"` Fragment bool `toml:"_fragment"` Partial bool `toml:"_partial"` Merge string `toml:"_merge"` Includes []string `toml:"_includes"` Blocks []TemplateBlock Block string }
RouteView is a handler + template pair corresponding to a single partial, it may contain a number of slots available for extention by sub views
type TemplateBlock ¶
TemplateBlock is a named child template slot within in a go template. Views is a list of RouteViews directly defined for that slot