aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/partials/following-list.html
blob: e99a86b728a5289f69e8aac47d0c06ef5f34e08d (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
{{- $feeds  := slice -}}
{{- $paths  := slice -}}
{{- $author := partial "function-authors-data.html" . -}}

{{- range $author.feeds.rss -}}
  {{- $data := split . " " -}}
  {{- $url := delimit (first 1 $data) "" -}}
  {{- $feeds = $feeds | append (string $url) -}}
{{- end -}}

<following-list>
  <h1>Following</h1>
  <aside>
    {{- range first 3 (shuffle $feeds) -}}
      {{- $sources := where $.Site.RegularPages "Params.feed.source" . -}}
      {{- $via := where $.Site.RegularPages "Params.Author" $author.user -}}
      {{- $following := $via | intersect $sources -}}

      {{- range first 1 $following -}}

        {{- $href := or .Params.feed.home (print "http://" .Params.feed.domain) -}}

        <micro-author>
          <micro-card>
            <micro-summary>
              <micro-thumbnail>
                <figure>
                  <a
                    title="{{ .Params.feed.name }}"
                    href="{{ $href }}">
                    <picture>
                      <img
                        width="64"
                        height="64"
                        alt="{{ .Params.feed.name }}"
                        src="{{ .Params.feed.favicon }}"
                      />
                    </picture>
                  </a>
                </figure>
              </micro-thumbnail>
              <micro-header>
                <h2>
                  <b>{{ .Params.feed.name }}</b>
                </h2>
                <h3>
                  <a
                    title="{{ .Params.feed.name }}"
                    href="{{ $href }}">
                    @{{ .Params.feed.domain }}
                  </a>
                </h3>
                <time
                  title="{{ .Date | time.Format "Monday, January 2, 2006 at 15:04:05 MST" }}"
                  datetime="{{ .Date | time.Format "2006-01-02T15:04:05Z" }}">
                  {{ (.Date.Local | time.Format "3:04 PM Jan 2 2006") -}}
                </time>
              </micro-header>
              <a
                title="Follow {{ .Params.feed.name }}"
                href="{{ $href }}">
                {{ safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/rss.svg")) }}
                <span>Follow</span>
              </a>
            </micro-summary>
          </micro-card>
        </micro-author>
      {{- else -}}
        <footer>
          <code>No feeds found!</code>
        </footer>
      {{- end -}}
    {{- else -}}
      <footer>
        <code>No feeds found!</code>
      </footer>
    {{- end -}}
  </aside>
</following-list>