aboutsummaryrefslogtreecommitdiff
path: root/internal/feed/template/feed.tpl.go
blob: 8aab9d71241d9be07173e7fb5c0d8f02f15179ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package template

var Feed = fromString("Feed", feedTpl)

//noinspection HtmlDeprecatedAttribute,HtmlUnknownTarget
const feedTpl = `{{- /*gotype:github.com/Necoro/feed2imap-go/internal/feed.feeditem*/ -}}
{{define "bottomLine"}}
  {{if .content}}
    <tr>
      <td align="right">
        <span style="color: #ababab; ">{{.descr}}</span>&nbsp;&nbsp;
      </td>
      <td>
        <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%">
            {{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%">
            {{with .Item.Link}}<a href="{{.}}">{{end}}
              <b>{{or .Item.Title .Item.Link}}</b>
            {{if .Item.Link}}</a>{{end}}
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
{{with .Item.Content}}
  <br /> <!-- originally: only if content and 'content !~ /\A\s*</m' -->
  {{html .}}
{{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>
      <td>
        <table width="100%" bgcolor="#EDEDED" cellpadding="2" cellspacing="2">
          <tr><td width="100%"><b>Files:</b></td></tr>
          {{range .}}
              <tr>
                <td>
                  &nbsp;&nbsp;&nbsp;
                  <a href={{.URL}}>{{.URL | lastUrlPart}}</a> ({{.Length | byteCount}}, {{.Type}})
                </td>
              </tr>
          {{end}}
        </table>
      </td>
    </tr>
  </table>
{{end}}
<hr width="100%"/>
<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" "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>`
>René 'Necoro' Neumann3-12/+13 2020-04-21HTML Template part of the mailRené 'Necoro' Neumann7-18/+199 2020-04-20Fixes and validationRené 'Necoro' Neumann6-28/+25 2020-04-20Fix vettingRené 'Necoro' Neumann1-1/+1 2020-04-20Started with mail creationRené 'Necoro' Neumann4-3/+126 2020-04-20FeeditemsRené 'Necoro' Neumann2-2/+14 2020-04-20GlobalOptionsRené 'Necoro' Neumann3-25/+79 2020-04-19RestructureRené 'Necoro' Neumann6-152/+177 2020-04-19Rename package 'parse' to 'feed'René 'Necoro' Neumann2-3/+3 2020-04-19SELECT is not necessary for most operations -- skip itRené 'Necoro' Neumann2-12/+1 2020-04-19Store path as array -- the delimiter is not always '.'René 'Necoro' Neumann3-36/+44 2020-04-19Split client part to client.goRené 'Necoro' Neumann2-125/+137 2020-04-19IMAP: Create foldersRené 'Necoro' Neumann1-4/+38 2020-04-19Improved IMAPRené 'Necoro' Neumann1-3/+88 2020-04-19Started IMAP connectionRené 'Necoro' Neumann4-0/+152 2020-04-19Use our own logger for debug for convenience sakeRené 'Necoro' Neumann1-2/+3 2020-04-19Fix debug logging m(René 'Necoro' Neumann1-2/+2 2020-04-19Rename util.go to log.go. Add verbose modeRené 'Necoro' Neumann4-24/+54 2020-04-19Clean go.modRené 'Necoro' Neumann2-3/+0 2020-04-19Do not print the parsedCfg anymoreRené 'Necoro' Neumann1-1/+1 2020-04-19Increase go-version to 1.14René 'Necoro' Neumann1-2/+2 2020-04-19CI: go vetRené 'Necoro' Neumann1-0/+3 2020-04-19Fetching and parsing the feedsRené 'Necoro' Neumann5-4/+113 2020-04-19Ignore all config*.ymlRené 'Necoro' Neumann1-1/+1