blob: 3da9ab22ff0e93a4cbb86939b50415b2e30fc493 (
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
|
{{- $profile := .Data.picture.profile -}}
{{- $file := not (urls.Parse $profile).Host -}}
{{- $host := (urls.Parse ("" | absURL)).Host -}}
{{- if not $host -}}
{{- $host = "localhost" -}}
{{- end -}}
{{- if $file -}}
{{- $profile = print .Data.user "/" $profile -}}
{{- end -}}
{{- $image := partial "function-caches-images.html"
(dict
"Source" $profile
"Fit" "160x160"
"Target" (print (partial "function-paths.html" "media") "/" .Data.user "/")
"Copy" (print (partial "function-paths.html" "media") "/" .Data.user "/" (path.Base $profile))
"AlternateCopy" (print (partial "function-paths.html" "media") "/" .Data.user "/" (path.BaseName $profile) ".webp")
)
-}}
{{- $width := $image.Width -}}
{{- $height := $image.Height -}}
{{- $source := $image.RelPermalink -}}
{{- $alternate := .Data.name -}}
{{- $sourceset := $image.AltRelPermalink -}}
{{- with .Params.feed.favicon -}}
{{- $width = "64" -}}
{{- $height = "64" -}}
{{- $source = $.Params.feed.favicon -}}
{{- $alternate = $.Params.feed.name -}}
{{- end -}}
<micro-author>
<micro-card>
<micro-summary>
<micro-thumbnail>
<figure>
<a title="{{ .Data.name }}" href="{{ "" | absURL }}/{{ .Data.user }}/#">
<picture>
{{- with $sourceset -}}
<source srcset="{{ $sourceset }}" type="image/webp" />
{{- end -}}
<img
width="{{ $width }}"
height="{{ $height }}"
src="{{ $source }}"
alt="{{ $alternate }}"
/>
</picture>
</a>
</figure>
</micro-thumbnail>
<micro-header>
<h2>
<b>{{ .Data.name }}</b>
</h2>
<h3>
<a title="{{ .Data.name }}" href="{{ "" | absURL }}/{{ .Data.user }}/#">{{ .Data.user }}@{{ $host }}</a>
</h3>
</micro-header>
<p>{{ .Data.description | markdownify | plainify | htmlUnescape | truncate 60 "..." }}</p>
<a title="Follow with RSS Reader" href="{{ "" | absURL }}/{{ .Data.user }}/rss.xml">
{{ safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/rss.svg")) }}
<span>Follow</span>
</a>
</micro-summary>
</micro-card>
</micro-author>
|