A webmail client. Forked from https://git.sr.ht/~migadu/alps
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

26 lines
491 B

  1. package koushin
  2. import (
  3. "html/template"
  4. "io"
  5. "github.com/labstack/echo/v4"
  6. )
  7. type tmpl struct {
  8. t *template.Template
  9. }
  10. func (t *tmpl) Render(w io.Writer, name string, data interface{}, c echo.Context) error {
  11. return t.t.ExecuteTemplate(w, name, data)
  12. }
  13. func loadTemplates() (*tmpl, error) {
  14. t, err := template.New("drmdb").Funcs(template.FuncMap{
  15. "tuple": func(values ...interface{}) []interface{} {
  16. return values
  17. },
  18. }).ParseGlob("public/*.html")
  19. return &tmpl{t}, err
  20. }