feat(whereami): add weather summary to og:description
This commit is contained in:
parent
f1bca887b2
commit
007f8c0838
1 changed files with 8 additions and 0 deletions
|
|
@ -6,11 +6,19 @@
|
|||
{{ else }}
|
||||
{{ with (. | transform.Unmarshal) }}
|
||||
{{ with .location.name }}{{ $title = printf "Adriano is in %s :: adriano.fyi" . }}{{ end }}
|
||||
{{ with .weather }}
|
||||
{{ $parts := slice }}
|
||||
{{ with .tempf }}{{ $parts = $parts | append (printf "%.0f°F" .) }}{{ end }}
|
||||
{{ with .humidity }}{{ $parts = $parts | append (printf "%.0f%% humidity" .) }}{{ end }}
|
||||
{{ with .windspeedmph }}{{ $parts = $parts | append (printf "wind %.1f mph" .) }}{{ end }}
|
||||
{{ $desc = delimit $parts ", " }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<title>{{ $title }}</title>
|
||||
<meta property="og:title" content="{{ $title }}">
|
||||
{{ with $desc }}<meta property="og:description" content="{{ . }}">{{ end }}
|
||||
<meta property="og:url" content="https://adriano.fyi/whereami">
|
||||
<meta property="og:type" content="website">
|
||||
{{ end }}
|
||||
|
|
|
|||
Loading…
Reference in a new issue