{{ stock }} shortcode for linking to a finance page for a stock ticker symbol

This commit is contained in:
Eryn Wells 2025-08-28 07:23:13 -06:00
parent eb9d763638
commit 24871ecf49

View file

@ -0,0 +1,10 @@
{{- $symbol := "" -}}
{{- $text := "" -}}
{{- if .IsNamedParams -}}
{{ $symbol = .Get "symbol" }}
{{ $text = .Params.text | default (printf "$%s" $symbol) }}
{{- else -}}
{{ $symbol = .Get 0 }}
{{ $text = printf "$%s" $symbol }}
{{- end -}}
<a href="https://finance.yahoo.com/quote/{{ $symbol }}">{{ $text }}</a>