Compare commits

..

2 Commits

Author SHA1 Message Date
8814467db9 chore: cleaned up logging 2021-07-24 12:44:38 +01:00
caa0b01937 chore: removed unused template functions 2021-07-24 12:42:43 +01:00
2 changed files with 1 additions and 19 deletions

View File

@ -44,7 +44,7 @@ func RefreshFeed(feedUrl string) Feed {
feed = *foundFeed
}
} else if err != nil {
fmt.Printf("Failed to refresh %s\n%v\n", feedUrl, err)
fmt.Printf("Failed to refresh %s - %v\n", feedUrl, err)
} else {
imageURL := ""
if f.Image != nil {

View File

@ -2,10 +2,7 @@ package server
import (
"fmt"
"html/template"
"time"
"github.com/dustin/go-humanize"
"github.com/gofiber/fiber/v2"
"github.com/gofiber/template/html"
@ -24,21 +21,6 @@ func Start(port string) error {
engine := html.New("./views", ".html")
engine.Reload(true)
engine.AddFunc("htmlSafe", func(html string) template.HTML {
return template.HTML(html)
})
engine.AddFunc("humanDate", func(date time.Time) template.HTML {
return template.HTML(humanize.Time(date))
})
engine.AddFunc("coalesce", func(args ...*string) string {
for _, s := range args {
if s != nil && *s != "" {
return *s
}
}
return ""
})
app := fiber.New(fiber.Config{
Views: engine,
})