mykiwi/mykiwi.blogpublic Fork 0
8145a2ac9ae8578fa5403ccbfb4b6c464fc65e58
Commits
Clone
git clone https://git.rickub.com/mykiwi/mykiwi.blog.git
git clone ssh://git@rickub.com/mykiwi/mykiwi.blog.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Add SRI fingerprinting, inline avatar blurhash, and a language switcher icon 51380a7 · on 8145a2ac9ae8578fa5403ccbfb4b6c464fc65e58 · Romain Gautier · 13h ago
colophon.html · 48 lines · 1.9 KBHTML Blame HistoryRaw
 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
{{- /*
  Bio card for the homepage. Ported from fzakaria.com's _includes/colophon.html.
  Reads entirely from site.Params.profile, so it renders nothing until that's
  configured in hugo.toml, and the avatar itself no-ops if the file is missing.
*/ -}}
{{- with site.Params.profile -}}
  {{- $profile := . -}}
<aside class="colophon" id="about">
  {{- with .avatar }}
    {{- with resources.Get . }}
      {{- /*
        Inlined (not a separate resources.Get file) so it paints with the
        first HTML response instead of racing the real photo over the
        network. 4x4 decode of the avatar's blurhash
        (oZL;Z^4m?wng-PoL~XNbOsShRjNGXTxt={xtM{xZo$t8%1a$IVRk%Nxut6W;IoWBj]V[V@RjR+s.) -
        regenerate it from a new avatar with a blurhash encoder/decoder if
        the avatar ever changes.
      */}}
      <img
        alt="{{ $profile.avatarAlt | default site.Title }}"
        style="background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAP0lEQVR42gE0AMv/AO3r6u7v+6Sco//9/wDLyqd5hnfju4PHx8QAsLOita+p0bOOycTFALuTaCBoRoeDRaKsnq0HINP5xdMWAAAAAElFTkSuQmCC')"
        width="{{ .Width }}"
        height="{{ .Height }}"
        class="colophon__avatar"
        src="{{ .RelPermalink }}"
      >
    {{- end }}
  {{- end }}
  <div>
    {{- if or .firstName .lastName }}
      <p class="colophon__name">{{ with .firstName }}{{ . }} {{ end }}<span class="colophon__name-last">{{ .lastName }}</span></p>
    {{- end }}
    {{- with .bio | default site.Params.description }}
      <div class="colophon__bio">{{ . | markdownify }}</div>
    {{- end }}
    {{- with .links }}
      <ul class="colophon__links">
        {{- range . }}
          <li>
            <span class="key">{{ .key }}</span>
            <span class="val"><a href="{{ .url }}">{{ .value }}</a></span>
          </li>
        {{- end }}
      </ul>
    {{- end }}
  </div>
</aside>
{{- end -}}