mirror of
https://github.com/Brandon-Rozek/website-theme.git
synced 2025-07-29 13:12:00 +00:00
Updated hugo way
This commit is contained in:
parent
cc623bd90a
commit
fd4db04d3a
1 changed files with 4 additions and 5 deletions
|
@ -35,13 +35,12 @@
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
{{ $apiUrl := printf "https://api.brandonrozek.com/highfive%s" .RelPermalink }}
|
{{ $apiUrl := printf "https://api.brandonrozek.com/highfive%s" .RelPermalink }}
|
||||||
{{ $resource := resources.GetRemote $apiUrl }}
|
|
||||||
{{ $initialCount := 0 }}
|
{{ $initialCount := 0 }}
|
||||||
{{ if $resource }}
|
{{ with try (resources.GetRemote $apiUrl) }}
|
||||||
{{ with $resource.Err }}
|
{{ with .Err }}
|
||||||
{{ warnf "Failed to fetch highfive data from %s: %s" $apiUrl . }}
|
{{ warnf "Failed to fetch highfive data from %s" $apiUrl }}
|
||||||
{{ $initialCount = 0 }}
|
|
||||||
{{ else }}
|
{{ else }}
|
||||||
|
{{ $resource := .Value }}
|
||||||
{{ $highfiveData := $resource | transform.Unmarshal }}
|
{{ $highfiveData := $resource | transform.Unmarshal }}
|
||||||
{{ if $highfiveData.count }}
|
{{ if $highfiveData.count }}
|
||||||
{{ $initialCount = $highfiveData.count }}
|
{{ $initialCount = $highfiveData.count }}
|
||||||
|
|
Loading…
Add table
Reference in a new issue