From 20321db72275ac317e44954c25eae1f19e276a2a Mon Sep 17 00:00:00 2001 From: June Yi Date: Wed, 1 Jul 2020 13:28:52 +0900 Subject: [PATCH] Revert #22223 --- layouts/shortcodes/upcoming-events.html | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/layouts/shortcodes/upcoming-events.html b/layouts/shortcodes/upcoming-events.html index 75d8fde0f9b1d..d6bbaa8c2af8f 100644 --- a/layouts/shortcodes/upcoming-events.html +++ b/layouts/shortcodes/upcoming-events.html @@ -2,4 +2,16 @@ {{/* Setting external resource based on whether hugo is running locally or public */}} -{{/* Disabled as this is breaking website builds */}} +{{ if .Site.IsServer }} +{{ $jurl := printf "" $date }} +{{ else }} +{{ $jurl := printf "https://www.googleapis.com/calendar/v3/calendars/nt2tcnbtbied3l6gi2h29slvc0%%40group.calendar.google.com/events?orderBy=startTime&singleEvents=true&%s&key=AIzaSyAST-sCyPJzMQJSl6_vRPW9r4DNLPaDIyM" $date }} +{{ $dataJ := getJSON $jurl }} + +{{ range first 4 $dataJ.items }} + {{ $url := findRE "(http|ftp|https)://([\\w_-]+(?:(?:\\.[\\w_-]+)+))([\\w.,@?^=%&:/~+#-]*[\\w@?^=%&/~+#-])?" .description }} + {{ $url := index $url 0 }} +
{{ .summary }} - {{ .location }} - {{ .start.date }}
+{{ end }} + +{{ end }}