mirror of
https://github.com/prdlk/glance.git
synced 2026-08-02 17:31:40 +00:00
41 lines
1.8 KiB
YAML
41 lines
1.8 KiB
YAML
# Macro rates box (St. Louis Fed / FRED). One shared template, three series.
|
|||
|
|
# ponytail: template was copy-pasted 4x across the config — collapsed to one anchor.
|
||
|
|
define:
|
||
|
|
fred-template: &fred-template |
|
||
|
|
{{ $latest := .JSON.Float "observations.0.value" }}
|
||
|
|
{{ $previous := .JSON.Float "observations.1.value" }}
|
||
|
|
{{ $lastObserve := .JSON.String "observations.0.date" }}
|
||
|
|
{{ $change := sub $latest $previous }}
|
||
|
|
<div class="flex justify-between items-center gap-15">
|
||
|
|
<div class="min-width-0">
|
||
|
|
<a class="size-h3 block color-highlight" href="https://fred.stlouisfed.org/" target="_blank" rel="noreferrer">
|
||
|
|
{{ .JSON.String "observations.0.value" }}%
|
||
|
|
</a>
|
||
|
|
<div class="text-truncate">St. Louis Federal Reserve</div>
|
||
|
|
</div>
|
||
|
|
<div class="shrink-0">
|
||
|
|
<div class="size-h3 text-right {{ if lt $change 0.0 }}color-positive{{ else if gt $change 0.0 }}color-negative{{ end }}">
|
||
|
|
{{ printf "%+.2f" $change }}%
|
||
|
|
</div>
|
||
|
|
<div class="text-right" title="As of {{ $lastObserve }}" {{ $lastObserve | parseRelativeTime "DateOnly" }}></div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
- type: custom-api
|
||
|
|
title: Secured Financing Rate
|
||
|
|
cache: 12h
|
||
|
|
url: https://api.stlouisfed.org/fred/series/observations?series_id=SOFR&api_key=${FRED_API_KEY}&file_type=json&sort_order=desc&limit=2
|
||
|
|
template: *fred-template
|
||
|
|
|
||
|
|
- type: custom-api
|
||
|
|
title: Federal Funds Rate
|
||
|
|
cache: 12h
|
||
|
|
url: https://api.stlouisfed.org/fred/series/observations?series_id=FEDFUNDS&api_key=${FRED_API_KEY}&file_type=json&sort_order=desc&limit=2
|
||
|
|
template: *fred-template
|
||
|
|
|
||
|
|
- type: custom-api
|
||
|
|
title: Real GDP
|
||
|
|
cache: 12h
|
||
|
|
url: https://api.stlouisfed.org/fred/series/observations?series_id=A191RL1Q225SBEA&api_key=${FRED_API_KEY}&file_type=json&sort_order=desc&limit=2
|
||
|
|
template: *fred-template
|