From b41368462c89dbfc5230350c46629266f03ad9d5 Mon Sep 17 00:00:00 2001 From: RenĂ© 'Necoro' Neumann Date: Tue, 16 Feb 2021 19:24:33 +0100 Subject: Use go-embed for templates instead of inline strings. They should also use CRLF (cf issue #46). --- internal/feed/template/html.tpl | 58 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 internal/feed/template/html.tpl (limited to 'internal/feed/template/html.tpl') diff --git a/internal/feed/template/html.tpl b/internal/feed/template/html.tpl new file mode 100644 index 0000000..b320ebb --- /dev/null +++ b/internal/feed/template/html.tpl @@ -0,0 +1,58 @@ +{{- /*gotype:github.com/Necoro/feed2imap-go/internal/feed.feeditem*/ -}} +{{define "bottomLine"}} + {{if .content}} + + + {{.descr}}   + + + {{.content}} + + + {{end}} +{{end}} + + + + + + + + + +
Feed + {{with .Feed.Link}}{{end}} + {{or .Feed.Title .Feed.Link "Unnammed feed"}} + {{if .Feed.Link}}{{end}} +
Item + {{with .Item.Link}}{{end}} + {{or .Item.Title .Item.Link}} + {{if .Item.Link}}{{end}} +
+{{with .Body}} + {{html .}} +{{end}} +{{with .Item.Enclosures}} + + + + + {{range .}} + + + + {{end}} +
Files:
+     + {{.URL | lastUrlPart}} ({{with .Length}}{{. | byteCount}}, {{end}}{{.Type}}) +
+{{end}} +
+ + {{template "bottomLine" (dict "descr" "Date:" "content" .Date)}} + {{template "bottomLine" (dict "descr" "Author:" "content" .Creator)}} + {{template "bottomLine" (dict "descr" "Filed under:" "content" (join ", " .Categories))}} + {{with .FeedLink}} + {{template "bottomLine" (dict "descr" "Feed-Link:" "content" (print "" . "" | html))}} + {{end}} +
\ No newline at end of file -- cgit v1.2.3-54-g00ecf