template

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DAY90 = 90 * 24 * time.Hour
	DAY10 = 10 * 24 * time.Hour
	DAY7  = 7 * 24 * time.Hour
	DAY   = 24 * time.Hour
)

Variables

View Source
var (
	Globals        = make(map[string]interface{})
	GlobalFuncs    = make(map[string]func(map[string]interface{}) interface{})
	ConfigFuncs    = make(map[string]func(config.Config) func(map[string]interface{}) interface{})
	ConfigFilters  = make(map[string]func(config.Config) pongo2.FilterFunction)
	RegisterTag    = pongo2.RegisterTag
	RegisterFilter = pongo2.RegisterFilter
)

Functions

func Expr

func Expr(expr string) (*pongo2.Template, error)

func Register

func Register(k string, v interface{})

func RegisterConfigFilter added in v0.1.2

func RegisterConfigFilter(k string, v func(config.Config) pongo2.FilterFunction)

func RegisterConfigFunc added in v0.1.2

func RegisterConfigFunc(k string, v func(config.Config) func(map[string]interface{}) interface{})

func RegisterFunc

func RegisterFunc(k string, v func(map[string]interface{}) interface{})

func RegisterStringFilter added in v0.1.2

func RegisterStringFilter(k string, f func(string) interface{})

Types

type Interface

type Interface interface {
	Lookup(string) (Writer, error)
}

func New

func New(conf config.Config, theme fs.FS) Interface

type Writer

type Writer interface {
	Name() string
	Write(string, map[string]interface{}) error
	Execute(map[string]interface{}) (string, error)
}

Jump to

Keyboard shortcuts

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