{{ $data := dict }} {{ $url := "https://status.cafe/users/yequari/status.json" }} {{ with resources.GetRemote $url }} {{ with .Err }} {{ errorf "%s" . }} {{ else }}
{{ $data = .Content | transform.Unmarshal }} {{ $length := len $data.content }} {{ if eq $length 0 }} No status {{ else }} {{ $timestrs := strings.Split $data.timeAgo " " }} {{ $timeamt := index $timestrs 0 }} {{ $timeunit := index $timestrs 1 }} {{ $timeunit = strings.Substr $timeunit 0 1 }} {{ $url = "https://status.cafe/users/yequari/badge.png" }} {{ with resources.GetRemote $url}}
Status Cafe Profile
{{ end }}
🕗{{ $timeamt }}{{ $timeunit }}

{{ $data.content }}

{{ end }} {{ end }} {{ else }} {{ errorf "Unable to get remote resource %q" $url }} {{ end }}