Updated hugo way

This commit is contained in:
Brandon Rozek 2025-06-15 22:32:52 -04:00
parent cc623bd90a
commit fd4db04d3a
No known key found for this signature in database
GPG key ID: DFB0E78F805F4567

View file

@ -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 }}