aboutsummaryrefslogtreecommitdiff
path: root/internal/feed/template/feed.tpl.go
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.eu>2020-05-07 23:32:34 +0200
committerRené 'Necoro' Neumann <necoro@necoro.eu>2020-05-07 23:32:34 +0200
commit0532548c8abf170aaf0abddab67561d2c499863a (patch)
treeefdfecae6aca97724f9e06952b451428f053b307 /internal/feed/template/feed.tpl.go
parent432e26e4177cf351953ac97474326a2f439beba5 (diff)
downloadfeed2imap-go-0532548c8abf170aaf0abddab67561d2c499863a.tar.gz
feed2imap-go-0532548c8abf170aaf0abddab67561d2c499863a.tar.bz2
feed2imap-go-0532548c8abf170aaf0abddab67561d2c499863a.zip
Improve html rendering
Diffstat (limited to 'internal/feed/template/feed.tpl.go')
-rw-r--r--internal/feed/template/feed.tpl.go74
1 files changed, 32 insertions, 42 deletions
diff --git a/internal/feed/template/feed.tpl.go b/internal/feed/template/feed.tpl.go
index c3aede5..10f870b 100644
--- a/internal/feed/template/feed.tpl.go
+++ b/internal/feed/template/feed.tpl.go
@@ -7,63 +7,53 @@ const feedTpl = `{{- /*gotype:github.com/Necoro/feed2imap-go/internal/feed.feedi
{{define "bottomLine"}}
{{if .content}}
<tr>
- <td align="right">
- <span style="color: #ababab; ">{{.descr}}</span>&nbsp;&nbsp;
+ <td style="text-align: right; padding: 0">
+ <span style="color: #ababab">{{.descr}}</span>&nbsp;&nbsp;
</td>
- <td>
- <span style="color: #ababab; ">{{.content}}</span>
+ <td style="padding: 0">
+ <span style="color: #ababab">{{.content}}</span>
</td>
</tr>
{{end}}
{{end}}
-<table border="1" width="100%" cellpadding="0" cellspacing="0" style="border-spacing: 0; ">
- <tr>
- <td>
- <table width="100%" bgcolor="#EDEDED" cellpadding="4" cellspacing="2">
- <tr>
- <td align="right"><b>Feed</b></td>
- <td width="100%">
+<table style="border: 2px black groove; background: #ededed; width: 100%; margin-bottom: 5px">
+ <tr>
+ <td style="text-align: right; padding: 4px"><strong>Feed</strong></td>
+ <td style="width: 100%; padding: 4px">
{{with .Feed.Link}}<a href="{{.}}">{{end}}
- <b>{{or .Feed.Title .Feed.Link "Unnammed feed"}}</b>
- {{if .Feed.Link}}</a>{{end}}
- </td>
- </tr>
- <tr>
- <td align="right"><b>Item</b></td>
- <td width="100%">
+ <strong>{{or .Feed.Title .Feed.Link "Unnammed feed"}}</strong>
+ {{if .Feed.Link}}</a>{{end}}
+ </td>
+ </tr>
+ <tr>
+ <td style="text-align: right; padding: 4px"><strong>Item</strong></td>
+ <td style="width: 100%; padding: 4px">
{{with .Item.Link}}<a href="{{.}}">{{end}}
- <b>{{or .Item.Title .Item.Link}}</b>
- {{if .Item.Link}}</a>{{end}}
- </td>
- </tr>
- </table>
- </td>
- </tr>
+ <strong>{{or .Item.Title .Item.Link}}</strong>
+ {{if .Item.Link}}</a>{{end}}
+ </td>
+ </tr>
</table>
{{with .Body}}
{{html .}}
{{end}}
{{with .Item.Enclosures}}
- <table border="1" width="100%" cellpadding="0" cellspacing="0" style="border-spacing: 0; ">
- <tr>
- <td>
- <table width="100%" bgcolor="#EDEDED" cellpadding="2" cellspacing="2">
- <tr><td width="100%"><b>Files:</b></td></tr>
- {{range .}}
- <tr>
+ <table style="border: 2px black groove; background: #ededed; width: 100%; margin-top: 5px">
+ <tr>
+ <td style="width: 100%"><strong>Files:</strong></td>
+ </tr>
+ {{range .}}
+ <tr>
<td>
- &nbsp;&nbsp;&nbsp;
- <a href={{.URL}}>{{.URL | lastUrlPart}}</a> ({{with .Length}}{{. | byteCount}}, {{end}}{{.Type}})
+ &nbsp;&nbsp;&nbsp;
+ <a href={{.URL}}>{{.URL | lastUrlPart}}</a> ({{with .Length}}{{. | byteCount}}, {{end}}{{.Type}})
</td>
- </tr>
- {{end}}
- </table>
- </td>
- </tr>
- </table>
+ </tr>
+ {{end}}
+ </table>
{{end}}
-<hr width="100%"/>
-<table width="100%" cellpadding="0" cellspacing="0">
+<hr style="width: 100%"/>
+<table style="width: 100%; border-spacing: 0">
{{template "bottomLine" (dict "descr" "Date:" "content" .Date)}}
{{template "bottomLine" (dict "descr" "Author:" "content" .Creator)}}
{{template "bottomLine" (dict "descr" "Filed under:" "content" (join ", " .Categories))}}