Add tailwind v2 CSS framework

This commit is contained in:
2024-08-01 18:25:25 -04:00
parent 920e7972af
commit 815c6a689d
5 changed files with 60 additions and 28 deletions

View File

@@ -7,8 +7,8 @@ import (
"strings"
)
func StaticTemplate(templatePath string) http.HandlerFunc {
tpl := views.Must(views.FromFS(templates.FS, templatePath))
func StaticTemplate(templatePath ...string) http.HandlerFunc {
tpl := views.Must(views.FromFS(templates.FS, templatePath...))
var testWriter strings.Builder
err := tpl.ExecuteWriter(&testWriter, nil)
@@ -19,7 +19,7 @@ func StaticTemplate(templatePath string) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) { tpl.Execute(w, nil) }
}
func FAQ(templatePath string) http.HandlerFunc {
func FAQ(templatePath ...string) http.HandlerFunc {
questions := []struct {
Question string
Answer string
@@ -34,7 +34,7 @@ func FAQ(templatePath string) http.HandlerFunc {
},
}
tpl := views.Must(views.FromFS(templates.FS, templatePath))
tpl := views.Must(views.FromFS(templates.FS, templatePath...))
var testWriter strings.Builder
err := tpl.ExecuteWriter(&testWriter, nil)