render

package
v0.0.0-...-82bc1ab Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoListing is returned when there is no configured Listing template for the current directory
	ErrNoListing = errors.New("no listing template available at this depth of the tree")
)

Functions

This section is empty.

Types

type Category

type Category struct {
	Site     *config.Site
	Section  *config.Section
	Category *config.Category
	Page     *content.Page
	Pages    content.Pages
	// contains filtered or unexported fields
}

Category is all of the data necessary to render an Category index page

func NewCategory

func NewCategory(section *Section, conf *config.Category) (category *Category, err error)

NewCategory creates a Category

func (*Category) Render

func (c *Category) Render(src, dst *content.Dir, force bool) (err error)

Render generates HTML for this Category, using the specified templates TODO: figure out how to not do this all the time

type Dir

type Dir struct {
	Site    *config.Site
	Section *config.Section
	Pages   content.Pages
	// contains filtered or unexported fields
}

Dir contains all of the data necessary to configure rendering for a Directory

func NewSectionDir

func NewSectionDir(section *Section) (dir *Dir, err error)

NewSectionDir creates a new Section

func (*Dir) Render

func (d *Dir) Render(src, dst *content.Dir, force bool) error

Render updates the contents of a destination directory from a source directory, for a given Dir config

func (*Dir) Sub

func (d *Dir) Sub(name string) *Dir

Sub creates a subdirectory of this directory

type Index

type Index struct {
	Site    *config.Site
	Section *config.Section
	Page    *content.Page
	Pages   content.Pages
	// contains filtered or unexported fields
}

Index is all of the data necessary to render an index page

func NewIndex

func NewIndex(d *Dir) (index *Index, err error)

NewIndex creates an Index

func (*Index) Render

func (i *Index) Render(src, dst *content.Dir, force bool) error

Render generates an index page using templates and page metadata

type Page

type Page struct {
	Site    *config.Site
	Section *config.Section
	Page    *content.Page
	// contains filtered or unexported fields
}

Page contains all of the data necessary to render a single content Page

func NewPage

func NewPage(d *Dir, p *content.Page) (page *Page, err error)

NewPage creates a new Page

func (*Page) Render

func (p *Page) Render(src, dst *content.Dir, force bool) error

Render generates the Page content as HTML, using the specified templates

type Section

type Section struct {
	Site   *config.Site
	Config *config.Section
	// contains filtered or unexported fields
}

Section contains all of the data necessary to configure rendering for a section

func NewSection

func NewSection(site *Site, name string, conf *config.Section) (section *Section, err error)

NewSection creates a new Section

func (*Section) Render

func (s *Section) Render(src, dst *content.Dir, force bool) (err error)

Render updates the contents of a destination tree from a source tree, for a given Section

type Site

type Site struct {
	Config *config.Site
	// contains filtered or unexported fields
}

Site is the content of the Site we are rendering

func NewSite

func NewSite(conf *config.Site, tmpls *templates.Tree) (site *Site, err error)

NewSite creates a Site from a configuration and template tree

func (*Site) Render

func (s *Site) Render(src, dst *content.Tree, force bool) error

Render each of the sections and the root pages of the site

Jump to

Keyboard shortcuts

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