aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/partials/author-header.html
blob: 9c969c9f6997bef06d7a2242725134abb9180923 (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
{{- $author := partial "function-authors-data.html" . -}}
{{- $header := $author.picture.header -}}
{{- $file := not (urls.Parse $header).Host -}}

{{- if $file -}}
  {{- $header = print $author.user "/" $header -}}
{{- end -}}

{{- $image := partial "function-caches-images.html"
  (dict
    "Source"        $header
    "Resize"        "x600"
    "Target"        (print (partial "function-paths.html" "media") "/" $author.user "/")
    "Copy"          (print (partial "function-paths.html" "media") "/" $author.user "/" (path.Base $header))
    "AlternateCopy" (print (partial "function-paths.html" "media") "/" $author.user "/" (path.BaseName $header) ".webp")
  )
-}}

{{- with $image.AltRelPermalink -}}
  <source srcset="{{ . }}" type="image/webp" />
{{- end -}}

<img
  width="{{ $image.Width }}"
  height="{{ $image.Height }}"
  src="{{ $image.RelPermalink }}"
  alt="{{ $author.name }}"
/>
{{- /* This comment removes trailing newlines and white spaces. */ -}}