small pixel drawing of a pufferfish vore

cutephrase cleanup squad
Jes Olson j3s@c3f.net
Thu, 25 May 2023 17:03:50 -0700
commit

7305d42d83e957207b006f8502f7935679e5fe58

parent

885c18b581fad0cb9c888b1d2f273bfb9c5c1636

4 files changed, 10 insertions(+), 25 deletions(-)

jump to
M files/head.tmpl.htmlfiles/head.tmpl.html

@@ -9,6 +9,7 @@ <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">

<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"> <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"> <link rel='shortcut icon' href='/favicon.ico'> + <link rel="stylesheet" href="/static/style.css"> <link rel="manifest" href="/manifest.json"> <script>

@@ -18,8 +19,5 @@ }

</script> <title>{{ .Title }}</title> -<style> -{{ .StyleSheet }} -</style> </head> {{end}}
M files/nav.tmpl.htmlfiles/nav.tmpl.html

@@ -2,7 +2,6 @@ {{ define "nav" }}

<nav> <h2> <a href="/{{ .Username }}">Vore</a> - <!-- <small>"{{ .CutePhrase }}"</small> --!> </h2> < {{ if .LoggedIn }}
M site.gosite.go

@@ -3,7 +3,6 @@

import ( "errors" "fmt" - "io/ioutil" "log" "net/http" "net/url"

@@ -314,33 +313,22 @@

tmplFiles := filepath.Join("files", "*.tmpl.html") tmpl := template.Must(template.New("whatever").Funcs(funcMap).ParseGlob(tmplFiles)) - // we read the stylesheet in order to render it inline - cssFile := filepath.Join("files", "style.css") - stylesheet, err := ioutil.ReadFile(cssFile) - if err != nil { - panic(err) - } - // fields on this anon struct are generally // pulled out of Data when they're globally required // callers should jam anything they want into Data pageData := struct { - Title string - Username string - LoggedIn bool - StyleSheet string - CutePhrase string - Data any + Title string + Username string + LoggedIn bool + Data any }{ - Title: page + " | " + s.title, - Username: s.username(r), - LoggedIn: s.loggedIn(r), - StyleSheet: string(stylesheet), - CutePhrase: s.randomCutePhrase(), - Data: data, + Title: page + " | " + s.title, + Username: s.username(r), + LoggedIn: s.loggedIn(r), + Data: data, } - err = tmpl.ExecuteTemplate(w, page, pageData) + err := tmpl.ExecuteTemplate(w, page, pageData) if err != nil { s.renderErr(w, err.Error(), http.StatusInternalServerError) return