small pixel drawing of a pufferfish vore

simplify, +changelog, -quotes, restyle, etc
Jes Olson j3s@c3f.net
Sun, 14 May 2023 02:42:42 -0700
commit

918c5fb97d57244c0214e060f9d2292838df6940

parent

23b29d9af141ef930163932e1a61790ffe8198fe

A files/changelog.tmpl.html

@@ -0,0 +1,16 @@

+{{ define "changelog" }} +{{ template "head" . }} +{{ template "nav" . }} +<p> +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 }}
M files/feeds.tmpl.htmlfiles/feeds.tmpl.html

@@ -1,14 +1,11 @@

{{ define "feeds" }} {{ template "head" . }} {{ template "nav" . }} -<h3>subscribed feeds</h3> -{{ if .LoggedIn }} -{{ $length := len .Data }} -{{ if eq $length 1 }} -<p>you're subscribed to 1 feed -{{ else }} -<p>you're subscribed to {{ len .Data }} feeds -{{ end }} +<h3>Settings</h3> +<p>timeline: <a href="/{{ .Username }}">https://vore.website/{{ .Username }}</a> + +{{ len .Data }} subscriptions: +</p> <form method="POST" action="/feeds/submit"> <textarea name="submit" rows="10" cols="50"> {{ range .Data -}}

@@ -16,27 +13,21 @@ {{ .UpdateURL }}

{{ end -}} </textarea> <br> -<input type="submit" value="update feeds"> +<input type="submit" value="subscribe"> </form> {{ $length := len .Data }} {{ if eq $length 0 }} -<pre> - ‼️ tutorial ‼️ - -vore supports one type of action: submitting feeds - -when you submit feeds: - - the feeds are validated and fetched - - the feeds are saved to the vore database - - your user is subscribed to the feeds +<p> + ‼️ tutorial ‼️ once you have subscribed to some feeds, -their posts will appear on your <a href="/{{ .Username }}">homepage</a> +their posts will appear on your timeline. -note that your homepage is public ‼️ +note that all timelines are public ‼️ -here are some feed urls to play with - copy them into -the text box above, then press [update feeds] +here are some feed urls to play with +copy them into the text box above +and press [subscribe] https://100r.co/links/rss.xml https://begriffs.com/atom.xml

@@ -55,20 +46,29 @@

/)/) ( . .) ( づ♡ -</pre> +</p> {{ else if gt $length 0 }} -<h3>feed details</h3> +<p>details:</p> {{ end }} {{ range .Data }} -<pre> -{{ .UpdateURL }} - title: {{ .Title | trimSpace }} - desc: {{ .Description | trimSpace }} - items: {{ len .Items }} -</pre> +<details> + <summary>{{ .UpdateURL }}</summary> +<p>Title: {{ .Title | trimSpace }} +Description: "{{ .Description | trimSpace }}" +Refresh: {{ .Refresh.Format "Jan 02, 15:04:05 UTC" }} +{{ len .Items }} Items:</p> +{{ range .Items }} +<details> + <summary>{{ .Title }}</summary> +<p>Categories: {{ .Categories }} +Date: {{ .Date }} +Link: {{ .Link }} +Summary: "{{ .Summary }}" +</p> +</details> {{ end }} -{{ else }} - <p>⚠️ unauthorized: please log in +</p> +</details> {{ end }} {{ template "tail" . }} {{ end }}
M files/index.tmpl.htmlfiles/index.tmpl.html

@@ -1,58 +1,32 @@

{{ define "index" }} {{ template "head" . }} {{ template "nav" . }} -<pre> -vore - a simple, multi-tenant feed reader +<p> +intro: -features: - - rss and atom support - - minimal, simple, reliable, fast - - refresh your feeds automatically - - display a chronological list of feed items - - open source & free of charge forever - (not the shitty open core kind of way) - - <a href="https://j3s.sh">jes</a> built it +vore.website is a minimal, no-bullshit web-based rss/atom feed reader. -anti-features: - - no tags - - no options - - no javascript - - no unread indicators or push notifs - - no comments, upvotes, or ranks +vore.website is free for anyone to use, and will never be turned into a vehicle for profit. - -welcome internet stranger! ( ˘͈ ᵕ ˘͈♡) +vore.website is a love letter to the rss world - long live syndication!!! -first of all: where are we? what sort -of new-york-times-ass looking pile of -shit has just rendered on your liquid -crystal display? -well, this is vore. +history: -i made vore because i was sick of the -state of rss/atom feed readers. my -needs are extremely basic, and i am -easily overwhelmed. + 2020: <a href="https://git.j3s.sh/jrss">jrss</a> is born +jrss had one concept: define list of feeds, and jrss will keep that list up to date and display it to you via the web. --> 2020: <a href="https://git.j3s.sh/jrss">jrss</a> is born -jrss had one concept: define list of -feeds, and jrss will keep that list up -to date and display it to you via the -web. + 2021: <a href="https://git.j3s.sh/j3s.sh">j3s.sh</a> consumes jrss +my main website eventually consumed jrss because it was easier to maintain. --> 2021: <a href="https://git.j3s.sh/j3s.sh">j3s.sh</a> consumes jrss -my main website eventually consumed jrss -because it was easier to maintain. + 2023: <a href="https://git.j3s.sh/vore">vore</a> +vore takes the simple foundation from j3s.sh and exposes it as a hosted service for anyone to use! +rss lovers rejoice. --> 2023: <a href="https://git.j3s.sh/vore">vore</a> -vore takes the simple foundation from -j3s.sh and exposes it as a hosted service -for anyone to use! rss lovers rejoice. -welcome to vore. enjoy your stay <3 +love, -<コ:彡 <コ:彡 <コ:彡 <コ:彡 <コ:彡 <コ:彡 <コ:彡 <コ:彡 <コ:彡 -</pre> +<a href="https://j3s.sh">jes</a> +</p> {{ template "tail" . }} {{ end }}
M files/login.tmpl.htmlfiles/login.tmpl.html

@@ -1,7 +1,7 @@

{{ define "login" }} {{ template "head" . }} {{ template "nav" . }} -<h3>login</h3> +<p>login: <form method="POST" action="/login"> <label for="username">username:</label> <input type="text" name="username" required>

@@ -11,7 +11,7 @@ <input type="password" name="password" required>

<br> <input type="submit" value="login"> </form> -<h3>register</h3> +<p>register: <form method="POST" action="/register"> <label for="username">username:</label> <input type="text" name="username" required>
M files/nav.tmpl.htmlfiles/nav.tmpl.html

@@ -1,19 +1,16 @@

{{ define "nav" }} <nav> - <h2><a href="/{{ .Username }}">vore.website</a></h2> - <hr> - <span class=left-text> - | {{ .CutePhrase }} - </span> - <span class=right-text> - {{ if .LoggedIn }} - <a href="/feeds">feeds</a></h3> | - <a href="/logout">logout</a> - {{ else }} - <a href="/login">login</a> - {{ end }} - | - </span> - <hr> +<h2> + <a href="/{{ .Username }}">Vore</a> + <!-- <small>"{{ .CutePhrase }}"</small> --!> +</h2> +< + {{ if .LoggedIn }} + <a href="/feeds">settings</a> | + <a href="/logout">logout</a> + {{ else }} + <a href="/login">login</a> + {{ end }} +> </nav> {{ end }}
M files/style.cssfiles/style.css

@@ -1,12 +1,20 @@

html { font-family: monospace; - max-width: 550px; - margin: 10px auto; + max-width: 600px; + margin: 20px auto; /* make sure the scrollbar is always shown so the width doesnt change between pages */ + font-size: calc(14px + 0.5vw); overflow-y: scroll; - font-size: 120%; - line-height: 1.6; +} + +p { + font-family: monospace; + white-space: pre-wrap; +} + +nav { + text-align: center; } a {

@@ -21,10 +29,6 @@ ul a:hover li {

background-color: #eaddca; } -h2 { - text-align: center; -} - ul { list-style-type: none; padding-left: 30px;

@@ -39,17 +43,6 @@

nav a { border-bottom: 1px dotted #000; color: #000; -} - -.left-text { - display: inline-block; - overflow-wrap: break-word; - max-width: 80%; -} - -.right-text { - float: right; - display: inline-block; } .puny {
M files/user.tmpl.htmlfiles/user.tmpl.html

@@ -4,7 +4,11 @@ {{ template "nav" . }}

{{ $length := len .Data.Items }} {{ if eq $length 0 }} {{ if .LoggedIn }} -<p> -> <a href="/feeds">add your first feed</a></p> +<p> +you don't seem to have any feeds yet. + +<a href="/feeds">add your first feed here!</a> +</p> {{ end }} {{ end }} <ul>
M main.gomain.go

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

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

@@ -65,9 +65,16 @@ return

} if s.loggedIn(r) { http.Redirect(w, r, "/"+s.username(r), http.StatusSeeOther) - } else { - s.renderPage(w, r, "index", nil) + return + } + s.renderPage(w, r, "index", nil) +} + +func (s *Site) changelogHandler(w http.ResponseWriter, r *http.Request) { + if !s.methodAllowed(w, r, "GET") { + return } + s.renderPage(w, r, "changelog", nil) } func (s *Site) loginHandler(w http.ResponseWriter, r *http.Request) {

@@ -144,15 +151,17 @@ s.renderPage(w, r, "user", data)

} -func (s *Site) feedsHandler(w http.ResponseWriter, r *http.Request) { +func (s *Site) settingsHandler(w http.ResponseWriter, r *http.Request) { if !s.methodAllowed(w, r, "GET") { return } + if !s.loggedIn(r) { + s.renderErr(w, "", http.StatusUnauthorized) + return + } var feeds []*rss.Feed - if s.loggedIn(r) { - feeds = s.reaper.GetUserFeeds(s.username(r)) - } + feeds = s.reaper.GetUserFeeds(s.username(r)) s.renderPage(w, r, "feeds", feeds) }

@@ -386,14 +395,8 @@ }

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", } i := rand.Intn(len(phrases)) return phrases[i]