blob: fbcab8c8a109edda7153b3e3731ce2956b3b90cd (
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
80
81
82
|
<micro-card>
<micro-summary>
<micro-thumbnail>
{{- $imageCanonicalURL := (print "https://" .FeedSourceDomain "/favicon.ico") -}}
{{- $imageTitle := "No image found" -}}
{{- $imageSource := "/images/404.png" -}}
{{- with $image := resources.GetRemote $imageCanonicalURL -}}
{{- with .Err -}}
{{ warnf "%s" . }}
{{- $fallbackImage := imageConfig (print "static/images/404.png") -}}
{{- with $fallbackImage -}}
{{- $fallbackWidth := .Width -}}
{{- $fallbackHeight := .Height -}}
{{ end }}
{{- else -}}
{{- $imageTitle = $imageCanonicalURL -}}
{{- $imageSource = $image.RelPermalink -}}
{{ end }}
<figure>
<a title="{{ $imageTitle }}" href=" {{ $imageSource }}">
<picture>
<img alt="" src="{{ $imageSource }}" />
</picture>
</a>
</figure>
{{ else }}
<figure>
<a title="{{ $imageTitle }}" href=" {{ $imageSource }}">
<picture>
<img alt="" src="{{ $imageSource }}" />
</picture>
</a>
</figure>
{{ end }}
</micro-thumbnail>
<micro-content>
<micro-metadata>
<micro-thumbnail hidden>
<figure>
<a title="{{ $imageTitle }}" href=" {{ $imageSource }}">
<picture>
<img alt="" src="{{ $imageSource }}" />
</picture>
</a>
</figure>
</micro-thumbnail>
<section>
<b>{{ .FeedName }}</b>
· <a
title="{{ .FeedSourceLink }}"
rel="noopener"
target="_blank"
href="{{ .FeedSourceLink }}">
@{{ .FeedSourceDomain }}
</a>
· <a href="{{ .FeedLink }}">
<time
datetime="{{ .FeedDateTime }}"
title="{{ .FeedDateTime | time.Format "Monday, January 2 2006 at 15:04:05 MST" }}">
{{ .FeedDate }}
</time>
</a>
· {{- partial "read-time.html" (dict "WordCount" .FeedWordCount) -}}
· <word-limit>
<word-count title="{{ .FeedWordCount }} words">
{{ .FeedWordCount }} words
</word-count>
</word-limit>
</section>
</micro-metadata>
<p>{{ .FeedContent }}.</p>
</micro-content>
</micro-summary>
</micro-card>
|