diff options
author | René 'Necoro' Neumann <necoro@necoro.eu> | 2020-04-26 00:21:47 +0200 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.eu> | 2020-04-26 00:21:47 +0200 |
commit | 87fd0ad3e9309064fe9fda373035f5ce127ae8d8 (patch) | |
tree | 0a076418994872a12c26b98320f600668722f25e /internal/feed/template/feed.tpl.go | |
parent | 92b3181672b62052d4193749cd02f4be7d91e2ee (diff) | |
download | feed2imap-go-87fd0ad3e9309064fe9fda373035f5ce127ae8d8.tar.gz feed2imap-go-87fd0ad3e9309064fe9fda373035f5ce127ae8d8.tar.bz2 feed2imap-go-87fd0ad3e9309064fe9fda373035f5ce127ae8d8.zip |
Improved HTML template
Diffstat (limited to 'internal/feed/template/feed.tpl.go')
-rw-r--r-- | internal/feed/template/feed.tpl.go | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/internal/feed/template/feed.tpl.go b/internal/feed/template/feed.tpl.go index bb49818..8aab9d7 100644 --- a/internal/feed/template/feed.tpl.go +++ b/internal/feed/template/feed.tpl.go @@ -40,14 +40,15 @@ const feedTpl = `{{- /*gotype:github.com/Necoro/feed2imap-go/internal/feed.feedi </td> </tr> </table> -{{with .Item.Description}} +{{with .Item.Content}} <br /> <!-- originally: only if content and 'content !~ /\A\s*</m' --> {{html .}} -{{end}} -{{with .Item.Content}} +{{else}} +{{with .Item.Description}} <br /> <!-- originally: only if content and 'content !~ /\A\s*</m' --> {{html .}} {{end}} +{{end}} {{with .Item.Enclosures}} <table border="1" width="100%" cellpadding="0" cellspacing="0" style="border-spacing: 0; "> <tr> @@ -71,6 +72,8 @@ const feedTpl = `{{- /*gotype:github.com/Necoro/feed2imap-go/internal/feed.feedi <table width="100%" cellpadding="0" cellspacing="0"> {{template "bottomLine" (dict "descr" "Date:" "content" .Item.Published)}} {{template "bottomLine" (dict "descr" "Author:" "content" .Creator)}} - {{template "bottomLine" (dict "descr" "Subject:" "content" .Item.Title)}} {{template "bottomLine" (dict "descr" "Filed under:" "content" (join ", " .Item.Categories))}} + {{with .Feed.FeedLink}} + {{template "bottomLine" (dict "descr" "Feed-Link:" "content" (print "<a style=\"color: #ababab;\" href=\"" . "\">" . "</a>" | html))}} + {{end}} </table>` |