small pixel drawing of a pufferfish vore

add discover, add quotes/phrases
Jes Olson j3s@c3f.net
Sun, 16 Jul 2023 12:33:15 -0500
commit

470c6cab738026e3ff56a215c8e7021043f0b1f4

parent

07825b21d809294b4bee2845d4362a1e55e7b709

7 files changed, 60 insertions(+), 34 deletions(-)

jump to
D files/changelog.tmpl.html

@@ -1,18 +0,0 @@

-{{ define "changelog" }} -{{ template "head" . }} -{{ template "nav" . }} -<p> -vore evolves. jes logs. - -2023-05-14 - - add changelog page - - makeover - - use less memory - - better err handling - - feeds -> settings - - update feeds -> subscribe - - add & compress feed details - - optimize a little for mobile -</p> -{{ template "tail" . }} -{{ end }}
A files/discover.tmpl.html

@@ -0,0 +1,23 @@

+{{ define "discover" }} +{{ template "head" . }} +{{ template "nav" . }} +<h3>discover cool feedz</h3> +<p><a href="https://sequentialread.com">SequentialRead</a> - home computing, depth, green +https://sequentialread.com/rss/ + +<a href="https://www.themarginalian.org/">themarginalian</a> - philosophy, existentialism, poetry +https://feeds.feedburner.com/brainpickings/rss + +<a href="https://computer.rip">computer.rip</a> - computer history, security +https://computer.rip/rss.xml + +<a href="https://leahreich.substack.com/">Meets Most</a> - soul, authenticity, tech commentary +https://leahreich.substack.com/feed + +want ur feed here? write me at j<code>3s<code>@<code>c3f<code>.net + +hand curated by <a href="https://j3s.sh">jes</a> <3 + +</p> +{{ template "tail" . }} +{{ end }}
M files/feeds.tmpl.htmlfiles/feeds.tmpl.html

@@ -2,8 +2,7 @@ {{ define "feeds" }}

{{ template "head" . }} {{ template "nav" . }} <h3>Settings</h3> -<p>your timeline: <a href="/{{ .Username }}">vore.website/{{ .Username }}</a> -vore changelog: <a href="/changelog">changelog</a> +<p>your public url: <a href="/{{ .Username }}">vore.website/{{ .Username }}</a> {{ len .Data }} subscriptions: </p>
M files/nav.tmpl.htmlfiles/nav.tmpl.html

@@ -3,13 +3,12 @@ <nav>

<h2> <a href="/{{ .Username }}">Vore</a> </h2> -< + <a href="/discover">discover</a> {{ if .LoggedIn }} - <a href="/feeds">settings</a> | + <a href="/feeds">settings</a> <a href="/logout">logout</a> {{ else }} <a href="/login">login</a> {{ end }} -> </nav> {{ end }}
M files/tail.tmpl.htmlfiles/tail.tmpl.html

@@ -1,2 +1,5 @@

{{ define "tail" }} +<footer> + <p class="puny"><i>{{ .CutePhrase }}</i> +</footer> {{ end }}
M main.gomain.go

@@ -11,7 +11,7 @@ mux := http.NewServeMux()

// rootHandler handles /, /<username>, and 404 mux.HandleFunc("/", s.rootHandler) - mux.HandleFunc("/changelog", s.changelogHandler) + mux.HandleFunc("/discover", s.discoverHandler) mux.HandleFunc("/feeds", s.settingsHandler) mux.HandleFunc("/feeds/submit", s.feedsSubmitHandler) mux.HandleFunc("/login", s.loginHandler)
M site.gosite.go

@@ -5,6 +5,7 @@ "errors"

"fmt" "html/template" "log" + "math/rand" "net/http" "net/url" "os"

@@ -83,11 +84,11 @@ }

s.renderPage(w, r, "index", nil) } -func (s *Site) changelogHandler(w http.ResponseWriter, r *http.Request) { +func (s *Site) discoverHandler(w http.ResponseWriter, r *http.Request) { if !s.methodAllowed(w, r, "GET") { return } - s.renderPage(w, r, "changelog", nil) + s.renderPage(w, r, "discover", nil) } func (s *Site) loginHandler(w http.ResponseWriter, r *http.Request) {

@@ -327,15 +328,17 @@ // 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 - Data any + Title string + Username string + LoggedIn bool + CutePhrase string + Data any }{ - Title: page + " | " + s.title, - Username: s.username(r), - LoggedIn: s.loggedIn(r), - Data: data, + Title: page + " | " + s.title, + Username: s.username(r), + LoggedIn: s.loggedIn(r), + CutePhrase: s.randomCutePhrase(), + Data: data, } err := tmpl.ExecuteTemplate(w, page, pageData)

@@ -429,3 +432,20 @@ s.renderErr(w, r.Method, http.StatusMethodNotAllowed)

} return allowed } + +func (s *Site) randomCutePhrase() string { + phrases := []string{ + "nom nom posts (๑ᵔ⤙ᵔ๑)", + "^(;,;)^ vawr", + "( -_•)╦̵̵̿╤─ - - - vore", + "devouring feeds since 2023", + "tfw new rss post (⊙ _ ⊙ )", + "( ˘͈ ᵕ ˘͈♡) <3", + "voreposting", + "vore dot website", + "a no-bullshit feed reader", + "*chomp* good feeds", + } + i := rand.Intn(len(phrases)) + return phrases[i] +}