From b41368462c89dbfc5230350c46629266f03ad9d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= 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/text.tpl | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 internal/feed/template/text.tpl (limited to 'internal/feed/template/text.tpl') diff --git a/internal/feed/template/text.tpl b/internal/feed/template/text.tpl new file mode 100644 index 0000000..57eef18 --- /dev/null +++ b/internal/feed/template/text.tpl @@ -0,0 +1,37 @@ +{{- /*gotype:github.com/Necoro/feed2imap-go/internal/feed.feeditem*/ -}} +{{- with .Item.Link -}} +<{{.}}> + +{{ end -}} +{{- with .TextBody -}} +{{.}} +{{ end -}} +{{- with .Item.Enclosures}} +Files: +{{- range . }} + {{ .URL}} ({{with .Length}}{{. | byteCount}}, {{end}}{{.Type}}) +{{- end -}} +{{- end}} +-- +Feed: {{ with .Feed.Title -}}{{.}}{{- end }} +{{ with .Feed.Link -}} + <{{.}}> +{{end -}} +Item: {{ with .Item.Title -}} + {{.}} +{{- end }} +{{ with .Item.Link -}} + <{{.}}> +{{end -}} +{{ with .Date -}} + Date: {{.}} +{{ end -}} +{{ with .Creator -}} + Author: {{.}} +{{ end -}} +{{ with (join ", " .Categories) -}} + Filed under: {{.}} +{{ end -}} +{{ with .FeedLink -}} + Feed-Link: {{.}} +{{ end -}} \ No newline at end of file -- cgit v1.2.3