small pixel drawing of a pufferfish j3s.sh

404, travel
Jes Olson j3s@c3f.net
Tue, 08 Nov 2022 20:20:48 -0800
commit

3450d2e63793d5019d47fbc1884c99eb6f481fe5

parent

c30e7ce3926693e9ec4f0aa0524355c68755a54c

3 files changed, 9 insertions(+), 7 deletions(-)

jump to
M main.gomain.go

@@ -97,12 +97,8 @@

func templateCombobulator(requestedPath string) (template.Template, error) { layoutPath := filepath.Join("templates", "layout.html") - info, err := os.Stat(requestedPath) + _, err := os.Stat(requestedPath) if err != nil { - return template.Template{}, err - } - - if info.IsDir() { return template.Template{}, err }

@@ -126,7 +122,7 @@

tmpl, err := templateCombobulator(requestedPath) if err != nil { log.Println(err.Error()) - http.Error(w, http.StatusText(500), 500) + http.Error(w, http.StatusText(404), 404) return }
A templates/404.html

@@ -0,0 +1,6 @@

+{{define "title"}}not found x__x{{end}} +{{define "body"}} +<pre> +(◎_◎;) 404 not found +</pre> +{{end}}
M templates/travel.htmltemplates/travel.html

@@ -1,4 +1,4 @@

-{{define "title"}}me{{end}} +{{define "title"}}tools/travel{{end}} {{define "body"}} <p>this is my travel checklist. you can use it too if you want i guess.</p> <h4>clothes</h4>