a few more urls for ease of use
This commit is contained in:
parent
9149144a2b
commit
1181ee6acf
2 changed files with 6 additions and 3 deletions
7
honk.go
7
honk.go
|
@ -111,7 +111,9 @@ func homepage(w http.ResponseWriter, r *http.Request) {
|
||||||
templinfo := getInfo(r)
|
templinfo := getInfo(r)
|
||||||
u := login.GetUserInfo(r)
|
u := login.GetUserInfo(r)
|
||||||
var honks []*Honk
|
var honks []*Honk
|
||||||
if u != nil {
|
if r.URL.Path == "/front" || u == nil {
|
||||||
|
honks = getpublichonks()
|
||||||
|
} else {
|
||||||
if r.URL.Path == "/atme" {
|
if r.URL.Path == "/atme" {
|
||||||
honks = gethonksforme(u.UserID)
|
honks = gethonksforme(u.UserID)
|
||||||
} else {
|
} else {
|
||||||
|
@ -119,8 +121,6 @@ func homepage(w http.ResponseWriter, r *http.Request) {
|
||||||
honks = osmosis(honks, u.UserID)
|
honks = osmosis(honks, u.UserID)
|
||||||
}
|
}
|
||||||
templinfo["HonkCSRF"] = login.GetCSRF("honkhonk", r)
|
templinfo["HonkCSRF"] = login.GetCSRF("honkhonk", r)
|
||||||
} else {
|
|
||||||
honks = getpublichonks()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
reverbolate(honks)
|
reverbolate(honks)
|
||||||
|
@ -1364,6 +1364,7 @@ func serve() {
|
||||||
getters := mux.Methods("GET").Subrouter()
|
getters := mux.Methods("GET").Subrouter()
|
||||||
|
|
||||||
getters.HandleFunc("/", homepage)
|
getters.HandleFunc("/", homepage)
|
||||||
|
getters.HandleFunc("/front", homepage)
|
||||||
getters.HandleFunc("/robots.txt", nomoroboto)
|
getters.HandleFunc("/robots.txt", nomoroboto)
|
||||||
getters.HandleFunc("/rss", showrss)
|
getters.HandleFunc("/rss", showrss)
|
||||||
getters.HandleFunc("/u/{name:[[:alnum:]]+}", showuser)
|
getters.HandleFunc("/u/{name:[[:alnum:]]+}", showuser)
|
||||||
|
|
|
@ -19,6 +19,8 @@
|
||||||
<span><a href="/c">combos</a></span>
|
<span><a href="/c">combos</a></span>
|
||||||
<details>
|
<details>
|
||||||
<summary>more</summary>
|
<summary>more</summary>
|
||||||
|
<span><a href="/about">about</a></span>
|
||||||
|
<span><a href="/front">front</a></span>
|
||||||
<span><a href="/xzone">xzone</a></span>
|
<span><a href="/xzone">xzone</a></span>
|
||||||
<span><a href="/zonkzone">zonkzone</a></span>
|
<span><a href="/zonkzone">zonkzone</a></span>
|
||||||
<span><a href="/account">account</a></span>
|
<span><a href="/account">account</a></span>
|
||||||
|
|
Loading…
Reference in a new issue