aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/_default/section.following.html
blob: f002d43b5e767fc2909b0ed7847b4fcae225c612 (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
{{- $parent := eq (len .Page.Ancestors) 1 -}}

{{- $modified := partial "function-page-modified.html"
  (dict
    "Context" .
    "Disable" true
  )
-}}

{{- if (and $parent $modified) -}}
  {{- $sources := slice -}}
  {{- $author := partial "function-authors-data.html" . -}}
  {{- $feeds := partial "function-generate-feeds.html" . -}}

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

  {{- range $source := $sources -}}
    {{- range $distinct := first 1 (where $feeds "FeedSourceLink" "eq" $source) -}}

      {{- $href := or $distinct.FeedHome (print "http://" $distinct.FeedSourceDomain) -}}
      {{- $favicon := print "/" (partial "function-paths.html").media "/favicon." (.FeedSourceLink | anchorize) ".png" -}}

      <micro-author>
        <micro-card>
          <micro-summary>
            <micro-thumbnail>
              <figure>
                <a
                  title="{{ $distinct.FeedName }}"
                  href="{{ $href }}">
                  <picture>
                    <img
                      width="64"
                      height="64"
                      alt="{{ $distinct.FeedName }}"
                      src="{{ $.Site.BaseURL }}{{ $favicon }}"
                    />
                  </picture>
                </a>
              </figure>
            </micro-thumbnail>
            <micro-header>
              <h2>
                <b>{{ $distinct.FeedName }}</b>
              </h2>
              <h3>
                <a
                  data-hover
                  title="{{ $distinct.FeedName }}"
                  href="{{ $href }}">
                  @{{ $distinct.FeedSourceDomain }}
                </a>
              </h3>
              <time
                data-type="default"
                title="{{ $distinct.FeedDateTitle }}"
                datetime="{{ $distinct.FeedDateTime }}">
                {{ $distinct.FeedDate -}}
              </time>
            </micro-header>
            <a
              title="Follow {{ $distinct.FeedName }}"
              href="{{ $href }}">
              {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/tabler/rss.svg")) }}
              <header>Follow</header>
            </a>
          </micro-summary>
        </micro-card>
      </micro-author>

    {{- end -}}
  {{- end -}}
{{- end -}}