aboutsummaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
Diffstat (limited to 'internal')
-rw-r--r--internal/feed/template/feed.tpl.go11
-rw-r--r--internal/feed/template/template.go6
2 files changed, 10 insertions, 7 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>`
diff --git a/internal/feed/template/template.go b/internal/feed/template/template.go
index 7871e06..4c7b636 100644
--- a/internal/feed/template/template.go
+++ b/internal/feed/template/template.go
@@ -9,11 +9,11 @@ import (
"github.com/Necoro/feed2imap-go/pkg/log"
)
-func dict(v ...string) map[string]string {
- dict := map[string]string{}
+func dict(v ...interface{}) map[string]interface{} {
+ dict := make(map[string]interface{})
lenv := len(v)
for i := 0; i < lenv; i += 2 {
- key := v[i]
+ key := v[i].(string)
if i+1 >= lenv {
dict[key] = ""
continue
bf4d5e71ee9d5c4293ef2f040eb1a191&follow=1'>Switch from openoffice alias to libreoffice (ooffice -> soffice)René 'Necoro' Neumann1-2/+2 2011-10-14Make the quotes in ProofGeneral to be nearly invisibleRené Neumann1-1/+1 2011-08-23Disable hightlighting of the domain in the FF urlbarRené Neumann1-0/+3 2011-08-12Enhance IE scriptRené Neumann1-6/+7 2011-08-11BlaRené 'Necoro' Neumann1-0/+2 2011-08-11Local fontsRené 'Necoro' Neumann1-13/+22 2011-08-11Better inconsolata thingsRené Neumann4-4/+13 2011-08-10Moved some functions to their own filesRené Neumann3-124/+120 2011-08-10More advanced IE scriptRené Neumann2-1/+74 2011-08-10Inconsolata also in emacsRené Neumann1-1/+1 2011-08-10Better vim fontsRené 'Necoro' Neumann1-1/+1 2011-08-09ooffice aliasRené Neumann1-0/+2 2011-08-09Update the needed hg-extensions.René Neumann1-1/+2 2011-06-08gtkrc stuff for Qt-Gtk-StyleRené 'Necoro' Neumann2-0/+8 2011-06-08Updated fonts.conf to work better on lcdsRené 'Necoro' Neumann1-17/+6