Back to godoc.org

Package layout

v0.0.0-...-42a2ac9
Latest Go to latest

The latest major version is .

Published: Aug 14, 2020 | License: MIT | Module: github.com/FooSoft/goldsmith-components

Overview

Package layout transforms content by applying Go templates to the content and metadata of HTML files. This plugin can be easily used with the "frontmatter" and "markdown" plugins to generate easy to maintain content-driven websites that are completely decoupled from layout details.

Index

type Layout

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

Layout chainable context.

func New

func New() *Layout

New creates a new instance of the Layout plugin.

func (*Layout) ContentKey

func (layout *Layout) ContentKey(key string) *Layout

ContentKey sets the metadata key used to access the source content (default: "Content").

func (*Layout) DefaultLayout

func (plugin *Layout) DefaultLayout(name string) *Layout

DefaultLayout sets the name of the layout to use if none is specified.

func (*Layout) Finalize

func (plugin *Layout) Finalize(context *goldsmith.Context) error

func (*Layout) Helpers

func (plugin *Layout) Helpers(helpers template.FuncMap) *Layout

Helpers sets the function map used to lookup template helper functions.

func (*Layout) Initialize

func (plugin *Layout) Initialize(context *goldsmith.Context) (goldsmith.Filter, error)

func (*Layout) LayoutKey

func (plugin *Layout) LayoutKey(key string) *Layout

LayoutKey sets the metadata key used to access the layout identifier (default: "Layout").

func (*Layout) Name

func (*Layout) Name() string

func (*Layout) Process

func (plugin *Layout) Process(context *goldsmith.Context, inputFile *goldsmith.File) error

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier