2020-11-10 14:41:52 -08:00
|
|
|
{{ define "hero" }}
|
2022-06-01 10:58:20 -07:00
|
|
|
{{ partial "hero" (dict "title" .Params.title ) }}
|
2020-11-10 14:41:52 -08:00
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ define "main" }}
|
|
|
|
<!-- Set the page context in a variable in a loop. -->
|
|
|
|
{{ $pageContext := . }}
|
|
|
|
|
2022-06-01 10:58:20 -07:00
|
|
|
|
2020-11-10 14:41:52 -08:00
|
|
|
<!-- Grab the webinar and event page data. -->
|
|
|
|
{{ $webinars := (where $.Site.Pages "Type" "webinars") }}
|
|
|
|
{{ $events := (where $.Site.Pages "Type" "events") }}
|
2023-07-24 21:31:34 -07:00
|
|
|
{{ $aiAnswers := (where $.Site.Pages "Type" "ai-answers") }}
|
2020-11-10 14:41:52 -08:00
|
|
|
|
2022-06-01 10:58:20 -07:00
|
|
|
|
2020-11-10 14:41:52 -08:00
|
|
|
<!-- Create dicts so we can sort the resources by start/publish date. -->
|
|
|
|
{{ $resourcesWithDate := slice }}
|
|
|
|
|
2022-06-01 10:58:20 -07:00
|
|
|
|
2020-11-10 14:41:52 -08:00
|
|
|
<!-- Create the resource data dicts for webinars. -->
|
|
|
|
{{ range $webinars }}
|
|
|
|
<!-- If the webinar is not marked as unlisted we will add it to the list. -->
|
|
|
|
{{ if eq .Params.unlisted false }}
|
2020-11-11 11:25:42 -08:00
|
|
|
|
|
|
|
<!-- If the webinar has multiple sessions we will choose the earliest session -->
|
|
|
|
{{ if isset .Params "multiple" }}
|
2021-01-11 17:22:30 -08:00
|
|
|
{{ $multipleEventData := . }}
|
|
|
|
{{ range .Params.multiple }}
|
|
|
|
{{ $resourcesWithDate = $resourcesWithDate | append (dict "date" .datetime "data" $multipleEventData) }}
|
|
|
|
{{ end }}
|
2020-11-11 11:25:42 -08:00
|
|
|
{{ else }}
|
|
|
|
{{ $resourcesWithDate = $resourcesWithDate | append (dict "date" .Params.main.sortable_date "data" .) }}
|
|
|
|
{{ end }}
|
2020-11-10 14:41:52 -08:00
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
|
2022-06-01 10:58:20 -07:00
|
|
|
|
2020-11-10 14:41:52 -08:00
|
|
|
<!-- Create the resource data dicts for events. -->
|
|
|
|
{{ range $events }}
|
|
|
|
<!-- If the webinar is not marked as unlisted we will add it to the list. -->
|
|
|
|
{{ if ne .Params.unlisted true }}
|
|
|
|
{{ $resourcesWithDate = $resourcesWithDate | append (dict "date" .Params.main.start_date "data" .) }}
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
|
2023-07-24 21:31:34 -07:00
|
|
|
<!-- Create the resource data dicts for AI answers. -->
|
|
|
|
{{ range $aiAnswers }}
|
|
|
|
{{ $resourcesWithDate = $resourcesWithDate | append (dict "date" .Date "data" .) }}
|
|
|
|
{{ end }}
|
|
|
|
|
2022-06-01 10:58:20 -07:00
|
|
|
|
2020-11-10 14:41:52 -08:00
|
|
|
<div class="pulumi-event-list-container mt-5">
|
|
|
|
<div class="container mx-auto pt-10">
|
|
|
|
<!-- These hidden elements help select the children elements so we can use CSS -->
|
|
|
|
<!-- to have the filter, well filter. -->
|
|
|
|
<span id="all" class="hidden"></span>
|
|
|
|
<span id="featured" class="hidden"></span>
|
|
|
|
<span id="upcoming" class="hidden"></span>
|
|
|
|
<span id="videos" class="hidden"></span>
|
2023-07-24 21:31:34 -07:00
|
|
|
<span id="ai-answers" class="hidden"></span>
|
2022-03-18 13:30:37 -07:00
|
|
|
<span id="whitepapers" class="hidden"></span>
|
2020-11-10 14:41:52 -08:00
|
|
|
|
|
|
|
<!-- The event filter -->
|
2022-03-15 10:07:14 -07:00
|
|
|
<div class="pulumi-event-list-container justify-center event-list-filter container mx-auto flex">
|
2022-06-01 10:58:20 -07:00
|
|
|
<div class="scroll-container hidden lg:flex items-center">
|
|
|
|
<button id="slideBackwards"><i class="text-gray-500 text-3xl fas fa-angle-left"></i></button>
|
|
|
|
</div>
|
2022-03-15 10:07:14 -07:00
|
|
|
<ul id="event-list-filter-nav">
|
|
|
|
{{ range $item := .Params.sections }}
|
2022-06-01 10:58:20 -07:00
|
|
|
<li data-filter-name="{{ $item.anchor }}">
|
2023-07-24 21:31:34 -07:00
|
|
|
<a class="whitespace-nowrap" href="#{{ $item.anchor }}">
|
2022-03-15 10:07:14 -07:00
|
|
|
<i class="fas fa-{{ $item.icon }} mr-2"></i>
|
2022-06-01 10:58:20 -07:00
|
|
|
<span>{{ $item.label }}</span>
|
2022-03-15 10:07:14 -07:00
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
{{ end }}
|
2020-11-10 14:41:52 -08:00
|
|
|
</ul>
|
2022-06-01 10:58:20 -07:00
|
|
|
<div class="scroll-container hidden lg:flex items-center">
|
|
|
|
<button id="slideForward"><i class="text-gray-500 text-3xl fas fa-angle-right"></i></button>
|
|
|
|
</div>
|
2020-11-10 14:41:52 -08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- Titles for the filtered section -->
|
2022-03-15 10:07:14 -07:00
|
|
|
<h3 class="ml-5 text-black" data-filter-title="all"><i class="fas fa-asterisk mr-8"></i>All</h3>
|
|
|
|
<h3 class="hidden ml-5 text-black" data-filter-title="featured"><i class="fas fa-star mr-8"></i>Featured</h3>
|
|
|
|
<h3 class="hidden ml-5 text-black" data-filter-title="upcoming"><i class="fas fa-users mr-8"></i>Upcoming Sessions</h3>
|
|
|
|
<h3 class="hidden ml-5 text-black" data-filter-title="videos"><i class="fas fa-video mr-8"></i>Videos</h3>
|
2023-07-24 21:31:34 -07:00
|
|
|
<h3 class="hidden ml-5 text-black" data-filter-title="ai-answers"><i class="fas fa-comments mr-8"></i>Pulumi AI Answers</h3>
|
2022-03-18 13:30:37 -07:00
|
|
|
<h3 class="hidden ml-5 text-black" data-filter-title="whitepapers"><i class="fas fa-book mr-8"></i>Whitepapers</h3>
|
2020-11-10 14:41:52 -08:00
|
|
|
<!-- Resources list. -->
|
|
|
|
<ul class="flex flex-wrap justify-center list-none p-0 sm:p-2 resource-list">
|
|
|
|
<!-- Loop over the resource items and create the tiles. -->
|
|
|
|
{{ range sort $resourcesWithDate "date" "desc" }}
|
|
|
|
{{ $data := .data }}
|
|
|
|
|
2022-06-01 10:58:20 -07:00
|
|
|
|
2020-11-10 14:41:52 -08:00
|
|
|
<!-- Create the values for rendering. -->
|
|
|
|
{{ $description := "" }}
|
|
|
|
{{ $displayDate := "" }}
|
|
|
|
{{ $link := "" }}
|
|
|
|
{{ $external := false }}
|
|
|
|
{{ $icon := "users" }}
|
|
|
|
{{ $filters := slice "all" }}
|
|
|
|
|
2022-06-01 10:58:20 -07:00
|
|
|
|
2023-03-16 11:35:20 -07:00
|
|
|
<!-- create values to determine if date is upcoming -->
|
2023-11-08 01:02:19 -05:00
|
|
|
{{ $nowUnix := now.UnixNano }}
|
2023-03-16 11:35:20 -07:00
|
|
|
<!-- add 24 hours to event date to list it for an extra day -->
|
2023-11-08 01:02:19 -05:00
|
|
|
{{ $eventDateUnix := (add (.date | time.AsTime).UnixNano (duration "hour" 24).Milliseconds) }}
|
2023-03-16 11:35:20 -07:00
|
|
|
|
|
|
|
|
2020-11-10 14:41:52 -08:00
|
|
|
<!-- Set the values based on the type of the page. -->
|
|
|
|
{{ if eq $data.Type "webinars" }}
|
|
|
|
{{ $description = $data.Params.meta_desc }}
|
2021-01-11 17:22:30 -08:00
|
|
|
{{ $displayDate = dateFormat "January 2, 2006" .date }}
|
2020-11-10 14:41:52 -08:00
|
|
|
|
2023-05-08 12:02:19 -07:00
|
|
|
{{ if $data.Params.main.hide_date }}
|
|
|
|
{{ $displayDate = "To be announced" }}
|
|
|
|
{{ end }}
|
|
|
|
|
2022-06-01 10:58:20 -07:00
|
|
|
|
2020-11-10 14:41:52 -08:00
|
|
|
<!-- Set the url to link to. -->
|
|
|
|
{{ if $data.Params.external }}
|
|
|
|
{{ $link = $data.Params.url_slug }}
|
|
|
|
{{ $external = true }}
|
|
|
|
{{ else }}
|
|
|
|
{{ $link = printf "/resources/%s" $data.Params.url_slug }}
|
|
|
|
{{ end }}
|
|
|
|
|
2021-01-11 17:22:30 -08:00
|
|
|
{{ if isset $data.Params "multiple" }}
|
2022-06-01 10:58:20 -07:00
|
|
|
{{ $link = printf "%s/?date=%s" $link (dateFormat "2006/01/02" .date) }}
|
2021-01-11 17:22:30 -08:00
|
|
|
{{ end }}
|
|
|
|
|
2022-06-01 10:58:20 -07:00
|
|
|
|
2020-11-10 14:41:52 -08:00
|
|
|
<!-- If the webinar is featured add the feature filter. -->
|
|
|
|
{{ if $data.Params.featured }}
|
|
|
|
{{ $filters = $filters | append "featured" }}
|
2022-06-01 10:58:20 -07:00
|
|
|
{{ end }}
|
|
|
|
|
2020-11-10 14:41:52 -08:00
|
|
|
|
|
|
|
<!-- Set the icon and appropriate filters for the webinar. -->
|
2021-09-10 09:48:53 -07:00
|
|
|
{{ if $data.Params.whitepaper }}
|
|
|
|
{{ $icon = "book" }}
|
2022-03-18 13:30:37 -07:00
|
|
|
{{ $filters = $filters | append "whitepapers" }}
|
2021-09-10 09:48:53 -07:00
|
|
|
{{ else if $data.Params.pulumi_tv }}
|
2020-11-10 14:41:52 -08:00
|
|
|
{{ $icon = "tv" }}
|
|
|
|
{{ $filters = $filters | append "pulumitv" }}
|
2022-06-01 10:58:20 -07:00
|
|
|
{{ else if $data.Params.pre_recorded }}
|
2020-11-10 14:41:52 -08:00
|
|
|
{{ $icon = "video" }}
|
|
|
|
{{ $filters = $filters | append "videos" }}
|
2023-03-16 11:35:20 -07:00
|
|
|
{{ else if lt $nowUnix $eventDateUnix }}
|
2020-11-10 14:41:52 -08:00
|
|
|
{{ $filters = $filters | append "upcoming" }}
|
|
|
|
{{ end }}
|
|
|
|
|
2023-07-24 21:31:34 -07:00
|
|
|
{{ else if eq $data.Type "events" }}
|
2020-11-10 14:41:52 -08:00
|
|
|
<!-- Set the appropriate values for the event. -->
|
|
|
|
{{ $description = $data.Params.event.description }}
|
|
|
|
{{ $displayDate = dateFormat "January 2, 2006" $data.Params.event.start_date }}
|
2022-06-01 10:58:20 -07:00
|
|
|
{{ $filters = $filters | append "upcoming" }}
|
|
|
|
|
2023-05-08 12:02:19 -07:00
|
|
|
{{ if $data.Params.main.hide_date }}
|
|
|
|
{{ $displayDate = "Date to be announced" }}
|
|
|
|
{{ end }}
|
|
|
|
|
2020-11-10 14:41:52 -08:00
|
|
|
|
|
|
|
<!-- If the event has a redirect attribute it is external so set the link correctly. -->
|
|
|
|
{{ if $data.Params.redirect_to }}
|
|
|
|
{{ $link = $data.Params.url_slug }}
|
|
|
|
{{ $external = true }}
|
|
|
|
{{ else }}
|
|
|
|
{{ $link = printf "/resources/%s" $data.Params.url_slug }}
|
|
|
|
{{ end }}
|
2023-07-24 21:31:34 -07:00
|
|
|
|
|
|
|
{{ else if eq $data.Type "ai-answers" }}
|
|
|
|
{{ $filters = $filters | append "ai-answers" }}
|
|
|
|
{{ $icon = "comments" }}
|
2023-07-26 10:29:07 -07:00
|
|
|
{{ $description = $data.Params.meta_desc }}
|
2023-07-24 21:31:34 -07:00
|
|
|
{{ $displayDate = dateFormat "January 2, 2006" $data.Date }}
|
|
|
|
{{ $link = $data.RelPermalink }}
|
2020-11-10 14:41:52 -08:00
|
|
|
{{ end }}
|
|
|
|
|
2022-06-01 10:58:20 -07:00
|
|
|
{{ $tileOptions := (dict "multiple" $data.Params.multiple "pageContext" $pageContext "external" $external "filters" $filters "link" $link "icon" $icon "description" $description "displayDate" $displayDate "data" $data) }}
|
2021-01-11 17:22:30 -08:00
|
|
|
{{ partial "content-tile.html" $tileOptions }}
|
2020-11-10 14:41:52 -08:00
|
|
|
{{ end }}
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{ end }}
|