Add topics for Gists (#413)

This commit is contained in:
Thomas Miceli
2025-01-24 14:39:42 +01:00
committed by GitHub
parent 8369cbf2f0
commit f5b8881d35
25 changed files with 278 additions and 59 deletions

View File

@ -179,6 +179,16 @@ func (s *Server) setFuncMap() {
_, err := url.ParseRequestURI(s)
return err == nil
},
"topicsToStr": func(topics []db.GistTopic) string {
str := ""
for i, topic := range topics {
if i > 0 {
str += " "
}
str += topic.Topic
}
return str
},
}
t := template.Must(template.New("t").Funcs(fm).ParseFS(templates.Files, "*/*.html"))