page

package
v0.0.0-...-3322d40 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2015 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Page

type Page struct {
	// contains filtered or unexported fields
}

Page is the overall page content to render.

func New

func New(tmpl ...string) *Page

New returns a new page. If it is supplied no arguments, the page is blank and loaded with the default configured layout. If it is supplied a single string argument, it loads the page content with the supplied file found in the defaultTemplateDir directory. If it is supplied two strings, the first file is loaded as the layout and the second is loaded as the page content.

func (*Page) LoadData

func (p *Page) LoadData(data interface{})

LoadData loads the supplied data to be rendered as mustache variables in the page on Write.

func (*Page) LoadLayout

func (p *Page) LoadLayout(name string)

LoadLayout loads the supplied layout, found in defaultTemplateDir, as the page layout.

func (*Page) LoadTmpl

func (p *Page) LoadTmpl(name string)

LoadTmpl loads the supplied template, found in defaultTemplateDir, as the page content template.

func (*Page) Write

func (p *Page) Write(w io.Writer)

Write writes the page contents to the supplied io.Writer.

Jump to

Keyboard shortcuts

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