mirror of
https://github.com/loot/loot.github.io.git
synced 2026-07-27 14:13:30 -07:00
It's currently easy to hit the GitHub API's rate limit just by refreshing the credits page a couple of times. The data doesn't change that frequently, so instead fetch it into a JSON file as part of the build process, have Hugo generate the page using the JSON file and a template, and deploy the site each day at midnight so that the live data is at most 24 hours old.
23 lines
738 B
HTML
23 lines
738 B
HTML
{{ define "main" }}
|
|
{{ .Content }}
|
|
|
|
<div id="contrib">
|
|
{{ $contributors := .Resources.Get "contributors.json" | transform.Unmarshal }}
|
|
{{ range $contributors }}
|
|
<a href="{{ .html_url }}" class="loot-contributor mdl-shadow--2dp">
|
|
<div class="loot-contributor__avatar">
|
|
{{- if .avatar_url }}
|
|
<img src="{{ .avatar_url }}"/>
|
|
{{- else }}
|
|
<i class="material-icons">face</i>
|
|
{{- end }}
|
|
</div>
|
|
<div class="loot-contributor__text">
|
|
<div class="loot-contributor__name">{{ .name }}</div>
|
|
<div class="loot-contributor__contributions">{{ .contributions }} contributions</div>
|
|
</div>
|
|
</a>
|
|
{{ end }}
|
|
</div>
|
|
{{ end }}
|