aboutsummaryrefslogtreecommitdiff
path: root/static.go
diff options
context:
space:
mode:
authorGabriel Arakaki Giovanini <mail@gabrielgio.me>2023-07-19 21:01:49 +0200
committerGabriel Arakaki Giovanini <mail@gabrielgio.me>2023-07-19 21:02:35 +0200
commitb8b6d3037c524575f140650ac243c16df6a98a92 (patch)
treebf9dfb99481389b6714041bc36fd8f23a1db332b /static.go
parentfbcac585cf626917e2baf1d0065c7b632341ba01 (diff)
downloadlens-b8b6d3037c524575f140650ac243c16df6a98a92.tar.gz
lens-b8b6d3037c524575f140650ac243c16df6a98a92.tar.bz2
lens-b8b6d3037c524575f140650ac243c16df6a98a92.zip
feat: Move last page to qtpl
Diffstat (limited to 'static.go')
-rw-r--r--static.go24
1 files changed, 0 insertions, 24 deletions
diff --git a/static.go b/static.go
index 1c6a086..06f1459 100644
--- a/static.go
+++ b/static.go
@@ -2,33 +2,9 @@ package img
import (
"embed"
- "fmt"
- "html/template"
- "io"
)
var (
- //go:embed templates/*.html
- TemplateFS embed.FS
-
//go:embed static/*
StaticFS embed.FS
-
- Template *template.Template
)
-
-type HTMLView[T any] struct {
- Title string
- Username string
- Data T
-}
-
-func Render[T any](w io.Writer, page string, view *HTMLView[T]) error {
- pageFile := fmt.Sprintf("templates/%s", page)
- tmpl, err := template.New("").ParseFS(TemplateFS, "templates/layout.html", pageFile)
- if err != nil {
- return err
- }
-
- return tmpl.ExecuteTemplate(w, page, view)
-}