handlebars

package module
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2025 License: MIT Imports: 10 Imported by: 1

README

Handlebars for Mojito

PRs Welcome

handlebars for Mojito provides a handlebars Renderer implementation that was designed specifically for Mojito with full compatibility.

SonarCloud Report


Quickstart

To start using handlebars as your renderer just enable it as the default renderer like this:

func init() {
    handlebars.AsDefault()
}

Or to use handlebars as a secondary renderer you can register it as a named renderer like this:

func init() {
    handlebars.As("myRenderer")
}

Documentation

Read our Documentation, check out the Project Website.

Icon made with Gopherize and flaticon.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func As

func As(name string, opts ...HandlebarsOption) error

func AsDefault

func AsDefault(opts ...HandlebarsOption) error

func TemplateDir

func TemplateDir() string

Types

type HandlebarsOption added in v0.0.3

type HandlebarsOption func(*HandlebarsRenderer) error

func WithTemplateDir added in v0.0.3

func WithTemplateDir(dir string) HandlebarsOption

type HandlebarsRenderer

type HandlebarsRenderer struct{}

func (*HandlebarsRenderer) Render

func (*HandlebarsRenderer) Render(view string, bag renderer.ViewBag) (string, error)

Render implements mojito.Renderer

func (*HandlebarsRenderer) SetTemplateDir

func (*HandlebarsRenderer) SetTemplateDir(path string) error

SetTemplateDir implements mojito.FileRenderer

func (*HandlebarsRenderer) TemplateDir

func (*HandlebarsRenderer) TemplateDir() string

TemplateDir implements mojito.FileRenderer

Jump to

Keyboard shortcuts

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