layouts

package
v0.113.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2023 License: Apache-2.0 Imports: 2 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LayoutDescriptor

type LayoutDescriptor struct {
	Type    string
	Section string

	// E.g. "page", but also used for the _markup render kinds, e.g. "render-image".
	Kind string

	// Comma-separated list of kind variants, e.g. "go,json" as variants which would find "render-codeblock-go.html"
	KindVariants string

	Lang   string
	Layout string
	// LayoutOverride indicates what we should only look for the above layout.
	LayoutOverride bool

	// From OutputFormat and MediaType.
	OutputFormatName string
	Suffix           string

	RenderingHook bool
	Baseof        bool
}

LayoutDescriptor describes how a layout should be chosen. This is typically built from a Page.

type LayoutHandler

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

LayoutHandler calculates the layout template to use to render a given output type.

func NewLayoutHandler

func NewLayoutHandler() *LayoutHandler

NewLayoutHandler creates a new LayoutHandler.

func (*LayoutHandler) For

func (l *LayoutHandler) For(d LayoutDescriptor) ([]string, error)

For returns a layout for the given LayoutDescriptor and options. Layouts are rendered and cached internally.

Jump to

Keyboard shortcuts

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