diff --git a/main.go b/main.go index 7364637..06e04b5 100644 --- a/main.go +++ b/main.go @@ -122,6 +122,17 @@ func main() { } return res }) + view.AddGlobal("url_encoded_path", func(m interface{}) string { + return url.PathEscape(m.(string)) + + }) + view.AddGlobal("url_decoded_path", func(m interface{}) string { + res, err := url.PathUnescape(m.(string)) + if err != nil { + return m.(string) + } + return res + }) e := echo.New() e.Renderer = &template{View: view} diff --git a/templates/repositories.html b/templates/repositories.html index b49492a..c4c9150 100644 --- a/templates/repositories.html +++ b/templates/repositories.html @@ -48,7 +48,7 @@
{{range repo := repos}}