/webring redirects to webring link

pull/4/head
cblgh 2021-05-11 20:46:42 +02:00
rodzic 44914e0f21
commit e0f9c73fd0
3 zmienionych plików z 18 dodań i 11 usunięć

Wyświetl plik

@ -9,7 +9,7 @@
serendipitous connexions.
</p>
<p>
This instance indexes the <a href="{{ .Data.RingLink }}">{{ .Data.WebringName }}</a> - {{ .Data.DomainCount }} domains,
This instance indexes <a href="{{ .Data.RingLink }}">{{ .Data.WebringName }}</a>{{ .Data.DomainCount }} domains,
{{ .Data.PageCount }} pages, {{ .Data.TermCount }} search terms.
Some domains of the webring have been filtered out for a better search experience,
see <a href="{{ .Data.FilteredLink }}">the filtered list</a>.

Wyświetl plik

@ -9,16 +9,18 @@
<div class="clear"></div>
<main>
<div class="lieu-container">
<h1>
{{ .SiteName }}
</h1>
<h2>
the search for the new—endless
</h2>
<form class="search-container">
<input type="search" required minlength="1" name="q" placeholder="tracking" value="{{ .Data.Query }}" class="search-box">
<button type="submit" class="search-button"></button>
</form>
<div>
<h1>
{{ .SiteName }}
</h1>
<h2>
the search for the new—endless
</h2>
<form class="search-container">
<input type="search" required minlength="1" name="q" placeholder="tracking" value="{{ .Data.Query }}" class="search-box">
<button type="submit" class="search-button"></button>
</form>
</div>
</div>
</main>
{{ template "footer" . }}

Wyświetl plik

@ -127,6 +127,10 @@ func (h RequestHandler) randomRoute(res http.ResponseWriter, req *http.Request)
http.Redirect(res, req, link, http.StatusSeeOther)
}
func (h RequestHandler) webringRoute(res http.ResponseWriter, req *http.Request) {
http.Redirect(res, req, h.config.General.URL, http.StatusSeeOther)
}
func (h RequestHandler) renderView(res http.ResponseWriter, tmpl string, view *TemplateView) {
view.SiteName = h.config.General.Name
errTemp := templates.ExecuteTemplate(res, tmpl+".html", view)
@ -140,6 +144,7 @@ func Serve(config types.Config) {
http.HandleFunc("/about", handler.aboutRoute)
http.HandleFunc("/", handler.searchRoute)
http.HandleFunc("/random", handler.randomRoute)
http.HandleFunc("/webring", handler.webringRoute)
http.HandleFunc("/filtered", handler.filteredRoute)
fileserver := http.FileServer(http.Dir("html/assets/"))