diff options
author | siddharth <s@ricketyspace.net> | 2022-05-22 18:23:22 -0400 |
---|---|---|
committer | siddharth <s@ricketyspace.net> | 2022-05-22 18:23:22 -0400 |
commit | 295d435a92544347e7718cab0302e0930b812977 (patch) | |
tree | 18584024fb47e0c5cb356943bbb0d2120c506d3a /main.go | |
parent | 6f7883f96cd80da47f38c00b3470e0e00adae4a5 (diff) |
html -> templates
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -22,11 +22,11 @@ var peachPort = flag.Int("p", 8151, "Port to run peach on") var peachAddr = "" // Holds static content. -//go:embed html static +//go:embed templates static var peachFS embed.FS // HTML templates. -var peachTemplates = template.Must(template.ParseFS(peachFS, "html/*.html")) +var peachTemplates = template.Must(template.ParseFS(peachFS, "templates/*.tmpl")) type Weather struct { Location string @@ -100,7 +100,7 @@ func showWeather(w http.ResponseWriter, lat, lng float32) { return } - err = peachTemplates.ExecuteTemplate(w, "weather.html", weather) + err = peachTemplates.ExecuteTemplate(w, "weather.tmpl", weather) if err != nil { http.Error(w, err.Error(), 500) return |