aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/partials/author-card.html
blob: 90e7781f29b23ae379619db88be31f0da3a68787 (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
{{- $path  := print "public/" .Data.user "/media/profile/picture.png" -}}
{{- $image := resources.Get $path -}}

<micro-author>
  <micro-card>
    <micro-summary>
    <micro-thumbnail>
      <figure>
        <a title="{{ .Data.name }}" href="{{ "" | absURL }}/{{ .Data.user }}">
          <picture>
            {{- with $image }}
              {{- $image = .Content | resources.FromString (print "/data/static/images/" ($image | urlize)) }}
              <source srcset="{{- ($image.Resize "x64 png").RelPermalink -}}"  type="image/png"  />
              <source srcset="{{- ($image.Resize "x64 jpg").RelPermalink -}}"  type="image/jpeg" />
              <source srcset="{{- ($image.Resize "x64 webp").RelPermalink -}}" type="image/webp" />
            {{- end }}
            <img
              alt="{{ .Data.name }}"
              {{- if fileExists $path }}
              {{ with $image }}
              {{- $image = (.Content | resources.FromString (print "/data/static/images/" ($image | urlize))).Resize "x64" -}}
              width="{{ $image.Width }}"
              height="{{ $image.Height }}"
              src="{{ $image.RelPermalink }}"
              {{- end }}
              {{ else }}
              {{- $404origin := print "/images/404.png" }}
              {{- $404image := imageConfig (print "static/" $404origin) }}
              width="{{ $404image.Width }}"
              height="{{ $404image.Height }}"
              src="{{ $404origin }}"
              {{- end -}}
            />
          </picture>
        </a>
      </figure>
    </micro-thumbnail>
      <micro-header>
        <h2><b>{{ .Data.name }}</b></h2>
        <h3><a title="" href="{{ "" | absURL }}/{{ .Data.user }}">@{{ .Data.user }}</a></h3>
      </micro-header>
      <a title="RSS" href="{{ "" | absURL }}/{{ .Data.user }}/rss.xml">
        {{ safeHTML (readFile "static/icons/feather/rss.svg") }}
        <span>Follow</span>
      </a>
    </micro-summary>
  </micro-card>
</micro-author>