package layouts

import "github.com/gohugoio/hugo/output/layouts"

Index

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.

Source Files

layout.go

Version
v0.144.2 (latest)
Published
Feb 19, 2025
Platform
linux/amd64
Imports
2 packages
Last checked
7 hours ago

Tools for package owners.