template

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

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

func New

func New(opts Options) *Engine

func (*Engine) Fragment

func (e *Engine) Fragment(name string, ttl int, part any, data any) (htmltemplate.HTML, error)

func (*Engine) Has

func (e *Engine) Has(page string) bool

func (*Engine) Render

func (e *Engine) Render(w http.ResponseWriter, status int, page string, data any) error

func (*Engine) RenderToBuffer

func (e *Engine) RenderToBuffer(page string, data any) (*bytes.Buffer, error)

type Options

type Options struct {
	FS       fs.FS
	Layout   string
	Shared   []string
	Funcs    htmltemplate.FuncMap
	Reload   bool
	Fragment cache.Cache
	OnError  func(error)
}

Jump to

Keyboard shortcuts

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