Files
hugo/layouts/partials/components/author-github-data.html
T
Joe Mooring 575d603450 Update docs for v0.141.0
Closes #2808
2025-01-16 14:51:03 +01:00

37 lines
991 B
HTML

{{ $author := .context.Params.author }}
{{ if $author }}
<aside class="mw5 br3 mv3 nested-links">
{{ $data := "" }}
{{ $url := urls.JoinPath "https://api.github.com/users" $author }}
{{ with try (resources.GetRemote $url) }}
{{ with .Err }}
{{ errorf "%s" . }}
{{ else with .Value }}
{{ $data = . | transform.Unmarshal }}
{{ else }}
{{ errorf "Unable to get remote resource %q" $url }}
{{ end }}
{{ end }}
{{ with $data }}
{{ with .name }}
<h3 class="f4 dib">
{{ . | htmlEscape }}
</h3>
{{ end }}
{{ with .bio }}
<p class="lh-copy measure center mt0 f6 black-60">
{{ . | htmlEscape }}
</p>
{{ end }}
{{ with .html_url }}
<a href="{{ . }}" class="link dim v-mid dib">
{{ partial "svg/github-squared.svg" (dict "fill" "gray" "width" "16" "height" "18") }}
</a>
{{ end }}
{{ end }}
</aside>
{{ end }}