summaryrefslogtreecommitdiffstats
path: root/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/components/author-github-data-card.html
blob: 4caa21f3e2dfce34541b0a87cea8ae38e2c6a315 (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
{{ $author := .context.Params.author }}
{{ if $author }}
  <aside class="mw5 center bg-white br3 pa3 pa4-ns mv3 ba b--black-10 nested-links">

    {{ $data := "" }}
    {{ $url := urls.JoinPath "https://api.github.com/users" $author }}
    {{ with resources.GetRemote $url }}
      {{ with .Err }}
        {{ errorf "%s" . }}
      {{ else }}
        {{ $data = . | transform.Unmarshal }}
      {{ end }}
    {{ else }}
      {{ errorf "Unable to get remote resource %q" $url }}
    {{ end }}

    <div class="tc">
      {{ with $data }}

        {{ with .avatar_url }}
          <a href="{{ . }}" class="link  hover-bg-light-gray pa1 br-100">
            <img src="{{ . }}&size={{ $.size }}" alt="" class="br-100 ba b--light-gray">
          </a>
        {{ end }}
        {{ with .name  }}
          <h3 class="f4">
            <a href="{{ $data.html_url }}" class="link dim">
              {{ . | htmlEscape }}
            </a>
          </h3>
          <hr class="mw3 bb bw1 b--black-10">
        {{ end }}
        {{ with .bio }}
          <p class="lh-copy measure center f6 black-70">
            {{ . | htmlEscape }}
          </p>
        {{ end }}

      {{ end }}
    </div>

  </aside>
{{ end }}