page

package
v0.0.0-...-c65c995 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2016 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	Name   string
	Path   string
	IsDir  bool
	Config *config.Config
	Data   interface{}
}

Info contains the information of a page

func (Info) BreadcrumbMap

func (i Info) BreadcrumbMap() map[string]string

BreadcrumbMap returns p.Path where every element is a map of URLs and path segment names.

func (i Info) PreviousLink() string

PreviousLink returns the path of the previous folder

type Page

type Page struct {
	*Info
	Minimal bool
}

Page contains the informations and functions needed to show the page

func (Page) PrintAsHTML

func (p Page) PrintAsHTML(w http.ResponseWriter, templates ...string) (int, error)

PrintAsHTML formats the page in HTML and executes the template

func (Page) PrintAsJSON

func (p Page) PrintAsJSON(w http.ResponseWriter) (int, error)

PrintAsJSON prints the current page infromation in JSON

Jump to

Keyboard shortcuts

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