Compare commits
2 Commits
ea8c2e4bbb
...
8814467db9
Author | SHA1 | Date | |
---|---|---|---|
8814467db9 | |||
caa0b01937 |
@ -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 {
|
||||
|
@ -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,
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user