diff options
Diffstat (limited to 'internal/template.go')
| -rw-r--r-- | internal/template.go | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/internal/template.go b/internal/template.go new file mode 100644 index 0000000..3d2fe4b --- /dev/null +++ b/internal/template.go @@ -0,0 +1,34 @@ +package internal + +import ( + "html/template" + "io" + + "github.com/labstack/echo/v4" +) + +type PageData struct { + Content template.HTML + Page string + Pages []string + Sections []string +} + +type SectionData struct { + Content template.HTML + Page string + Sections []string +} + +type TemplateRenderer struct { + Template *template.Template +} + +func (t *TemplateRenderer) Render( + w io.Writer, + name string, + data interface{}, + c echo.Context, +) error { + return t.Template.ExecuteTemplate(w, name, data) +} |