small pixel drawing of a pufferfish j3s.sh

*smiles heavily*
Jesse Olson j3s@c3f.net
Sat, 16 Apr 2022 02:59:24 +0000
commit

e2bb51e81bfc67a7abbed87aec30b17d63d5c923

parent

f2c6b9c98ffa6356341780379871cff2db68ee77

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

jump to
M main.gomain.go

@@ -6,6 +6,7 @@ "fmt"

"html/template" "io" "log" + "math/rand" "net/http" "os" "path/filepath"

@@ -27,6 +28,7 @@ // global since it may need to be available in arbitrary

// contexts. maybe that sucks. but idfk! type templateData struct { FriendFeeds []rss.Feed + TitleWord string } var data templateData

@@ -83,6 +85,11 @@ log.Println(err.Error())

http.Error(w, http.StatusText(500), 500) return } + + var wordList []string + wordList = append(wordList, "shit hell", "silly heart", "stupid head", "stingray herd", "sjkgksjdfg hjghjko", "server horror", "shrinking horizon", "sunday hat", "safe house", "/bin/sh haha", "simply hopeless", "*smiles heavily*", "sob hut") + wordIndex := rand.Intn(len(wordList)) + data.Word = wordList[wordIndex] err = tmpl.ExecuteTemplate(w, "layout", data) if err != nil {
M templates/layout.htmltemplates/layout.html

@@ -39,7 +39,7 @@

<body class="grayscale"> <div id="header"> <a href="/"><img src="/static/unnamed-puffy.png" height="111" width="140" alt="pic of an unnamed pufferfish, drawn by rekka bellum of kokorobot.ca and hundred rabbits :3"></a> - <h1>jes? somewhat horrible</h1> + <h1>jes's {{ .TitleWord }}</h1> <p> <a href="/now.html">now</a> <a href="/about.html">about</a>