sgs and other for all pages
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Arnas Udovic 2023-06-29 15:52:55 +03:00
parent eeeb242a5f
commit bf568a8652

16
main.go
View file

@ -223,8 +223,12 @@ func renderIndex(lang string, w gemini.ResponseWriter, client TreeManagerClient)
} }
func renderFeed(lang string, w gemini.ResponseWriter, r *gemini.Request, client TreeManagerClient) { func renderFeed(lang string, w gemini.ResponseWriter, r *gemini.Request, client TreeManagerClient) {
langFilter := TreeRequest_Filter{Key: "lang", Value: lang} filters := []*TreeRequest_Filter{{Key: "lang", Value: lang}}
filters := []*TreeRequest_Filter{&langFilter} if lang == "sgs" {
for _, l := range []string{"lt", "prg", "eo"} {
filters = append(filters, &TreeRequest_Filter{Key: "lang", Value: l})
}
}
path := "" path := ""
tr := TreeRequest{Path: &path, Filter: filters} tr := TreeRequest{Path: &path, Filter: filters}
@ -408,8 +412,12 @@ func renderFile(lang string, w gemini.ResponseWriter, r *gemini.Request, client
} }
func renderAllFiles(lang string, w gemini.ResponseWriter, client TreeManagerClient) { func renderAllFiles(lang string, w gemini.ResponseWriter, client TreeManagerClient) {
langFilter := TreeRequest_Filter{Key: "lang", Value: lang} filters := []*TreeRequest_Filter{{Key: "lang", Value: lang}}
filters := []*TreeRequest_Filter{&langFilter} if lang == "sgs" {
for _, l := range []string{"lt", "prg", "eo"} {
filters = append(filters, &TreeRequest_Filter{Key: "lang", Value: l})
}
}
path := "" path := ""
tr := TreeRequest{Path: &path, Filter: filters} tr := TreeRequest{Path: &path, Filter: filters}