diff options
author | Martin Fischer <martin@push-f.com> | 2025-04-06 09:59:04 +0200 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2025-04-13 20:19:48 +0200 |
commit | 96166f3f17a048499cd6c9af95e81d8f4c655978 (patch) | |
tree | bfd461325a80dbe2949c3ab06cabbfa2bee6f61e | |
parent | d218bee6b8ab4fd10bec88269270a2412bdbbb46 (diff) |
refactor: rename views/ to templates/
-rw-r--r-- | lexsurf.go | 6 | ||||
-rw-r--r-- | templates/index.html.tmpl (renamed from views/index.html) | 0 | ||||
-rw-r--r-- | templates/search.html.tmpl (renamed from views/search.html) | 0 |
3 files changed, 3 insertions, 3 deletions
@@ -53,7 +53,7 @@ func main() { var tpl, _ = template.New("").Funcs(template.FuncMap{ "ToUpper": strings.ToUpper, -}).ParseGlob("views/*") +}).ParseGlob("templates/*") type handler struct { domain string @@ -68,7 +68,7 @@ func (h *handler) handle(w http.ResponseWriter, r *http.Request) { w.Write([]byte("page not found")) return } - err := tpl.ExecuteTemplate(w, "index.html", map[string]any{ + err := tpl.ExecuteTemplate(w, "index.html.tmpl", map[string]any{ "Countries": h.countries, "Domain": r.Host, }) @@ -109,7 +109,7 @@ func (h *handler) handle(w http.ResponseWriter, r *http.Request) { } } _, hasJSONLaws := h.lawsByCC[cc] - err := tpl.ExecuteTemplate(w, "search.html", map[string]any{ + err := tpl.ExecuteTemplate(w, "search.html.tmpl", map[string]any{ "TLD": cc, "Domain": h.domain, "Country": h.countries[cc], diff --git a/views/index.html b/templates/index.html.tmpl index 3d8c04f..3d8c04f 100644 --- a/views/index.html +++ b/templates/index.html.tmpl diff --git a/views/search.html b/templates/search.html.tmpl index 70c8c86..70c8c86 100644 --- a/views/search.html +++ b/templates/search.html.tmpl |