support many languages
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Arnas Udovicius 2022-08-30 19:54:55 +03:00
parent 5e1b9b7e60
commit 4080d7992f
3 changed files with 7 additions and 21 deletions

View file

@ -8,10 +8,10 @@ My capsule in Gemini space. Built with zord-tree support
## TODO ## TODO
* add image or other file not `gmi` download * add image or other file not `gmi` download
* feed
* security * security
* citata from some file * citata from some file
__DONE__ __DONE__
* feed
* add category view * add category view
* add tag view * add tag view
* add file view * add file view

View file

@ -147,8 +147,12 @@ func process(_ context.Context, w gemini.ResponseWriter, r *gemini.Request) {
} }
func renderIndex(lang string, w gemini.ResponseWriter, client TreeManagerClient) { func renderIndex(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}

View file

@ -1,18 +0,0 @@
package main
import (
"bufio"
"fmt"
"net"
)
func GetSummery() string {
conn, err := net.Dial("tcp", fileSrvHost+":"+fileSrvPort)
if err != nil {
panic(err.Error())
}
fmt.Fprintf(conn, "\n")
message, err := bufio.NewReader(conn).ReadString('\n')
conn.Close()
return message
}