templates

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResourceExists

func ResourceExists(path string) bool

func Template

func Template(path string, data map[string]any) (string, error)

Template renders a template from the embedded files, using a cache to avoid reparsing the template on every call.

Example:

data := map[string]any{
	"Title": "Hello World",
}

template, err := templates.Template("index.html", data)
if err != nil {
	panic(err)
}

func ToBytes

func ToBytes(path string) ([]byte, error)

func ToString

func ToString(path string) (string, error)

func Tpl

func Tpl(path string, data map[string]any) string

Tpl is a shortcut for Template that ignores errors

Types

This section is empty.

Jump to

Keyboard shortcuts

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