MtF-wiki/layouts/shortcodes/gh-profile.html

10 lines
351 B
HTML
Raw Normal View History

2021-12-12 15:01:03 +08:00
{{- $name := .Get 1 -}}
{{- with getJSON (printf "https://api.github.com/users/%s" (.Get 0)) -}}
2021-12-24 17:39:54 +08:00
{{- $avatar := resources.GetRemote .avatar_url -}}
<a class="github-profile" href="{{ .html_url }}" title="{{ $name | default .name }}">
2021-12-24 17:39:54 +08:00
<img src="{{ $avatar.Permalink }}">
2021-12-12 15:03:45 +08:00
<b>{{ $name | default .name }}</b>
2021-12-12 15:01:03 +08:00
<i class="bi bi-github"></i>
</a>
{{- end -}}