Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
gochist committed Jul 1, 2020
1 parent 91e2961 commit 20321db
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion layouts/shortcodes/upcoming-events.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
<div class="event"><a href="{{ safeHTML $url }}">{{ .summary }}</a> - {{ .location }} - {{ .start.date }}</div>
{{ end }}

{{ end }}

0 comments on commit 20321db

Please sign in to comment.