From 24871ecf496e4728e616cb83f7ee730c8635054f Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Thu, 28 Aug 2025 07:23:13 -0600 Subject: [PATCH] {{ stock }} shortcode for linking to a finance page for a stock ticker symbol --- layouts/shortcodes/stock.html | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 layouts/shortcodes/stock.html diff --git a/layouts/shortcodes/stock.html b/layouts/shortcodes/stock.html new file mode 100644 index 0000000..9030a45 --- /dev/null +++ b/layouts/shortcodes/stock.html @@ -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 -}} +{{ $text }}