rename saves -> archives
Jes Olson j3s@c3f.net
Thu, 14 Aug 2025 09:02:41 -0500
6 files changed,
53 insertions(+),
48 deletions(-)
A
files/archive.tmpl.html
@@ -0,0 +1,41 @@
+{{ define "archive" }} +{{ template "head" . }} +{{ template "nav" . }} + +{{ $length := len .Data }} {{ if eq $length 0 }} +{{ if .LoggedIn }} +<p> +you haven't archived anything yet. :( + +use the "archive" button to archive posts that you like! + +vore's archive system is unique: + when you click the "archive" button, vore will: + - submit an https://archive.org request on your behalf for the linked page + - store the article + archive link together + +this ensures that all archived articles will remain +accessible forever! + +it also means that you may archive the same article +more than once, if you'd like! + +currently, archived items cannot be deleted. +</p> +{{ end }} +{{ end }} +<ul> +{{ range .Data }} + <li> + <a href="{{ .ItemURL }}">{{ .ItemTitle }}</a> + <span class=puny> + (<a href="{{ .ArchiveURL }}">archived</a>) + </span> + <br> + <span class=puny>archived {{ .CreatedAt }} via <a href="//{{ .ItemURL | printDomain }}">{{ .ItemURL | printDomain }}</a></span> + </li> +{{ end }} +</ul> + +{{ template "tail" . }} +{{ end }}
D
files/saves.tmpl.html
@@ -1,41 +0,0 @@
-{{ define "saves" }} -{{ template "head" . }} -{{ template "nav" . }} - -{{ $length := len .Data }} {{ if eq $length 0 }} -{{ if .LoggedIn }} -<p> -you haven't saved anything yet. :( - -use the "save" button to save posts that you like! - -vore's save system is unique: - when you click the "save" button, vore will: - - submit an https://archive.org request on your behalf for the linked page - - store the article + archive link together - -this ensures that all saved articles will remain -accessible forever! - -it also means that you may save the same article -more than once, if you'd like! - -currently, saves cannot be deleted. -</p> -{{ end }} -{{ end }} -<ul> -{{ range .Data }} - <li> - <a href="{{ .ItemURL }}">{{ .ItemTitle }}</a> - <span class=puny> - (<a href="{{ .ArchiveURL }}">archived</a>) - </span> - <br> - <span class=puny>saved {{ .CreatedAt }} via <a href="//{{ .ItemURL | printDomain }}">{{ .ItemURL | printDomain }}</a></span> - </li> -{{ end }} -</ul> - -{{ template "tail" . }} -{{ end }}
M
files/user.tmpl.html
→
files/user.tmpl.html
@@ -25,7 +25,7 @@ {{ .Link | printDomain }}</a>
| <a href="#" data-save-url="/save/{{ .Link | escapeURL }}" onclick="saveItem(this); return false;"> - save + archive </a> </span> </li>@@ -39,7 +39,7 @@ const states = [".", "..", "..."];
let index = 0; const intervalId = setInterval(() => { - element.textContent = "saving" + states[index]; + element.textContent = "archiving" + states[index]; index = (index + 1) % states.length; }, 300);@@ -52,7 +52,7 @@ return response.text();
}) .then(data => { clearInterval(intervalId); - element.textContent = "saved!"; + element.textContent = "archived!"; }) .catch(error => { console.error(error);
M
main.go
→
main.go
@@ -10,7 +10,7 @@ s := New()
http.HandleFunc("GET /{$}", s.indexHandler) http.HandleFunc("GET /{username}", s.userHandler) - http.HandleFunc("GET /saves", s.userSavesHandler) + http.HandleFunc("GET /archive", s.userSavesHandler) http.HandleFunc("GET /static/{file}", s.staticHandler) http.HandleFunc("GET /finger", s.fingerHandler) http.HandleFunc("POST /finger", s.fingerHandler)@@ -24,9 +24,10 @@ http.HandleFunc("POST /register", s.registerHandler)
http.HandleFunc("GET /save/{url}", s.saveHandler) http.HandleFunc("GET /feeds/{url}", s.feedDetailsHandler) - // backwards compatibility redirect + // backwards compatibility redirects http.HandleFunc("GET /settings", s.settingsRedirectHandler) http.HandleFunc("POST /settings/submit", s.settingsSubmitRedirectHandler) + http.HandleFunc("GET /saves", s.savesRedirectHandler) log.Println("main: listening on http://localhost:5544") log.Fatal(http.ListenAndServe(":5544", nil))
M
site.go
→
site.go
@@ -196,7 +196,7 @@ }
username := s.username(r) saves := s.db.GetUserSavedItems(username) - s.renderPage(w, r, "saves", saves) + s.renderPage(w, r, "archive", saves) } func (s *Site) settingsHandler(w http.ResponseWriter, r *http.Request) {@@ -574,6 +574,10 @@ }
func (s *Site) settingsSubmitRedirectHandler(w http.ResponseWriter, r *http.Request) { http.Redirect(w, r, "/feeds/submit", http.StatusMovedPermanently) +} + +func (s *Site) savesRedirectHandler(w http.ResponseWriter, r *http.Request) { + http.Redirect(w, r, "/archive", http.StatusMovedPermanently) } func (s *Site) randomCutePhrase() string {