templates

package
v0.128.1 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: Apache-2.0 Imports: 9 Imported by: 9

Documentation

Overview

Package templates provides template functions for working with templates.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeferOpts added in v0.128.0

type DeferOpts struct {
	// Optional cache key. If set, the deferred block will be executed
	// once per unique key.
	Key string

	// Optional data context to use when executing the deferred block.
	Data any
}

type Namespace

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

Namespace provides template functions for the "templates" namespace.

func New

func New(deps *deps.Deps) *Namespace

New returns a new instance of the templates-namespaced template functions.

func (*Namespace) Defer added in v0.128.0

func (ns *Namespace) Defer(args ...any) (bool, error)

Defer defers the execution of a template block.

func (*Namespace) DoDefer added in v0.128.0

func (ns *Namespace) DoDefer(ctx context.Context, id string, optsv any) string

DoDefer defers the execution of a template block. For internal use only.

func (*Namespace) Exists

func (ns *Namespace) Exists(name string) bool

Exists returns whether the template with the given name exists. Note that this is the Unix-styled relative path including filename suffix, e.g. partials/header.html

Jump to

Keyboard shortcuts

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