From d9a1b256ad75446f5fc5146d3c86935b0c145596 Mon Sep 17 00:00:00 2001 From: jtbx Date: Tue, 23 Jan 2024 19:29:41 +0100 Subject: [PATCH] Calendar: Link to first URL from description --- themes/ccchh/layouts/shortcodes/calendar-table.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/themes/ccchh/layouts/shortcodes/calendar-table.html b/themes/ccchh/layouts/shortcodes/calendar-table.html index 9de76d1..fe95d70 100644 --- a/themes/ccchh/layouts/shortcodes/calendar-table.html +++ b/themes/ccchh/layouts/shortcodes/calendar-table.html @@ -13,7 +13,12 @@ {{- $start := time .dtstart }} {{ $start.Local.Format "Mon, 2006-01-02 15:04" }} + {{- $potentialUrl := index (findRE `https?://\S*` .description 1) 0 }} + {{- if eq $potentialUrl nil }} {{ .summary }} + {{- else }} + {{ .summary }} + {{- end }} {{ .location }} {{- end }}