aboutsummaryrefslogtreecommitdiff
path: root/internal/feed/template/template.go
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.eu>2021-02-16 19:24:33 +0100
committerRené 'Necoro' Neumann <necoro@necoro.eu>2021-02-16 19:24:33 +0100
commitb41368462c89dbfc5230350c46629266f03ad9d5 (patch)
treea3f2e0b0918c2b68ae29f9c5b235878b4494c644 /internal/feed/template/template.go
parent3a854c3bc47e75491b836c7fc12b617da5d68288 (diff)
downloadfeed2imap-go-b41368462c89dbfc5230350c46629266f03ad9d5.tar.gz
feed2imap-go-b41368462c89dbfc5230350c46629266f03ad9d5.tar.bz2
feed2imap-go-b41368462c89dbfc5230350c46629266f03ad9d5.zip
Use go-embed for templates instead of inline strings.
They should also use CRLF (cf issue #46).
Diffstat (limited to 'internal/feed/template/template.go')
-rw-r--r--internal/feed/template/template.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/internal/feed/template/template.go b/internal/feed/template/template.go
index d8eb850..09dacf1 100644
--- a/internal/feed/template/template.go
+++ b/internal/feed/template/template.go
@@ -15,6 +15,15 @@ type Template interface {
Execute(wr io.Writer, data interface{}) error
}
+//go:embed html.tpl
+var htmlTpl string
+
+//go:embed text.tpl
+var textTpl string
+
+var Html = fromString("Feed", htmlTpl, true)
+var Text = fromString("Feed", textTpl, false)
+
func must(t Template, err error) Template {
if err != nil {
panic(err)