Can't forget the funzone emus
Peter Sanchez pjs@petersanchez.com
Thu, 12 May 2022 13:53:16 -0600
2 files changed,
5 insertions(+),
1 deletions(-)
M
views/funzone.html
→
views/funzone.html
@@ -3,8 +3,9 @@ <main>
<div class="info"> <p>Welcome the fun zone! <ul> +{{ $m := .Emuext }} {{ range .Emus }} -<li><img class="emu" src="/emu/{{ . }}.png"> :{{ . }}: +<li><img class="emu" src="/emu/{{ . }}{{ index $m . }}"> :{{ . }}: {{ end }} </ul> <ul>
M
web.go
→
web.go
@@ -148,6 +148,7 @@ }
func showfunzone(w http.ResponseWriter, r *http.Request) { var emunames, memenames []string + emuext := make(map[string]string) dir, err := os.Open(dataDir + "/emus") if err == nil { emunames, _ = dir.Readdirnames(0)@@ -156,6 +157,7 @@ }
for i, e := range emunames { if len(e) > 4 { emunames[i] = e[:len(e)-4] + emuext[emunames[i]] = e[len(e)-4:] } } dir, err = os.Open(dataDir + "/memes")@@ -167,6 +169,7 @@ sort.Strings(emunames)
sort.Strings(memenames) templinfo := getInfo(r) templinfo["Emus"] = emunames + templinfo["Emuext"] = emuext templinfo["Memes"] = memenames err = readviews.Execute(w, "funzone.html", templinfo) if err != nil {