mirror of
https://github.com/rramiachraf/dumb.git
synced 2025-04-04 21:37:38 +03:00
feat: add search functionality
This commit is contained in:
parent
b7c91e7f1b
commit
dd0ee8723b
8 changed files with 198 additions and 6 deletions
3
utils.go
3
utils.go
|
@ -62,7 +62,8 @@ func getTemplates(templates ...string) []string {
|
|||
|
||||
func render(n string, w http.ResponseWriter, data interface{}) {
|
||||
w.Header().Set("content-type", "text/html")
|
||||
t, err := template.ParseFiles(getTemplates(n, "navbar", "footer")...)
|
||||
t := template.New(n + ".tmpl").Funcs(template.FuncMap{"extractURL": extractURL})
|
||||
t, err := t.ParseFiles(getTemplates(n, "navbar", "footer")...)
|
||||
if err != nil {
|
||||
logger.Errorln(err)
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue