render

package
v0.0.0-...-2233bd7 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(a, b int) int

func AddDefaultData

func AddDefaultData(td *models.TemplateData, r *http.Request) *models.TemplateData

AddDefaultData adds data for all templates

func CreateTemplateCache

func CreateTemplateCache() (map[string]*template.Template, error)

CreateTemplateCache creates a template cache as a map

func FormatDate

func FormatDate(t time.Time, f string) string

FormatDate formats the date

func HumanDate

func HumanDate(t time.Time) string

HumanDate returns time in YYYY-MM-DD format

func Iterate

func Iterate(count int) []int

Iterate returns a slice of int, starting at 1, going to count

func NewRenderer

func NewRenderer(a *config.AppConfig)

NewRenderer sets the config for the template package

func Template

func Template(w http.ResponseWriter, r *http.Request, tmpl string, td *models.TemplateData) error

Template renders templates using html/template

Types

This section is empty.

Jump to

Keyboard shortcuts

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