diff --git a/layouts/custom/current_location.html b/layouts/custom/current_location.html index cc8e247..e0f6343 100644 --- a/layouts/custom/current_location.html +++ b/layouts/custom/current_location.html @@ -1,8 +1,9 @@ {{ define "title" }} - {{ try }} - {{ $d := resources.GetRemote "https://jellybee.bison-lizard.ts.net/whereami" | transform.Unmarshal }} - {{ $title := "Where Am I? :: adriano.fyi" }} - {{ $desc := "" }} + {{ $title := "Where Am I? :: adriano.fyi" }} + {{ $desc := "" }} + {{ $r := try (resources.GetRemote "https://jellybee.bison-lizard.ts.net/whereami") }} + {{ if not $r.Err }} + {{ $d := $r.Value | transform.Unmarshal }} {{ with $d.location.name }}{{ $title = printf "Adriano is in %s :: adriano.fyi" . }}{{ end }} {{ with $d.weather }} {{ $parts := slice }} @@ -11,55 +12,53 @@ {{ with .windspeedmph }}{{ $parts = $parts | append (printf "wind %.1f mph" .) }}{{ end }} {{ $desc = delimit $parts ", " }} {{ end }} -