all repos — honk @ 28c66a2af968b82c77d7136dceec907cba5a4746

my fork of honk

Can't forget the funzone emus
Peter Sanchez pjs@petersanchez.com
Thu, 12 May 2022 13:53:16 -0600
commit

28c66a2af968b82c77d7136dceec907cba5a4746

parent

024b9236d7d88c1f5c224678db5b1db03f8749cf

2 files changed, 5 insertions(+), 1 deletions(-)

jump to
M views/funzone.htmlviews/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.goweb.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 {