cach-radio/inc/themes/castanet/layouts/guest/single.html

119 lines
6.1 KiB
HTML

{{ define "main" }}
<div class = "hero_container">
<div class="row">
<div class="col">
<h1>{{ title .Title }} {{ with .Params.Pronouns }}({{ . }}){{ end }}</h1>
</div>
</div>
{{ .Scratch.Delete "guest-names" }}
<div class = "row">
<div class="col-lg-8">
<div class="row">
<div class="col-md-3">
{{- if and (isset .Params "thumbnail") (ne .Params.thumbnail "") -}}
{{- if (eq (slicestr .Params.thumbnail 0 4) "http") -}}
<img alt="{{ .Title }}" src="{{ .Params.thumbnail }}" class="img-fluid episode_image" width="250px">
{{- else -}}
<img alt="{{ .Title }}" src="{{ .Params.thumbnail | absURL}}" class="img-fluid episode_image" width="250px">
{{- end -}}
{{- else -}}
<img alt="{{ .Title }}" src="{{ "img/guest/default-guest.png" | absURL }}" class="img-fluid episode_image" width="250px"/>
{{- end -}}
</div>
<div class="col-md-8">
<div class = "row">
<div class="col">
{{ .Content }}
</div>
</div>
<div class = "row">
<div class = "col guest_social_icons">
{{ if .Params.Website }}
<a href="{{ .Params.Website }}">
<i class="fas fa-home fa-2x"></i>
</a>
{{ end }}
{{ if .Params.Twitter }}
{{ partial "social-link.html" (dict "context" .Params.Twitter "aclass" "" "iclass" "fab fa-twitter-square fa-2x" "prefix" "https://twitter.com/" "text" "") }}
{{ end }}
{{ if .Params.GitHub }}
{{ partial "social-link.html" (dict "context" .Params.GitHub "aclass" "" "iclass" "fab fa-github-square fa-2x" "prefix" "https://github.com/" "text" "") }}
{{ end }}
{{ if .Params.LinkedIn }}
{{ partial "social-link.html" (dict "context" .Params.LinkedIn "aclass" "" "iclass" "fab fa-linkedin fa-2x" "prefix" "https://www.linkedin.com/in/" "text" "") }}
{{ end }}
{{ if .Params.Facebook }}
{{ partial "social-link.html" (dict "context" .Params.Facebook "aclass" "" "iclass" "fab fa-facebook-square fa-2x" "prefix" "https://www.facebook.com/" "text" "") }}
{{ end }}
{{ if .Params.Pinterest }}
{{ partial "social-link.html" (dict "context" .Params.Pinterest "aclass" "" "iclass" "fab fa-pinterest-square fa-2x" "prefix" "https://www.pinterest.com/" "text" "") }}
{{ end }}
{{ if .Params.Instagram }}
{{ partial "social-link.html" (dict "context" .Params.Instagram "aclass" "" "iclass" "fab fa-instagram fa-2x" "prefix" "https://www.instagram.com/" "text" "") }}
{{ end }}
{{ if .Params.YouTube }}
{{ partial "social-link.html" (dict "context" .Params.YouTube "aclass" "" "iclass" "fab fa-youtube-square fa-2x" "prefix" "https://www.youtube.com/" "text" "") }}
{{ end }}
{{ if .Params.Twitch }}
{{ partial "social-link.html" (dict "context" .Params.Twitch "aclass" "" "iclass" "fab fa-twitch fa-2x" "prefix" "https://twitch.tv/" "text" "") }}
{{ end }}
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-4">
<div class = "row">
<div class="col">
<h3>Episodes Featuring {{ .Title }} {{ with .Params.Pronouns }}({{ . }}){{ end }}</h3>
{{- with .Params.guest_group -}}
{{- range where $.Site.Pages "Params.guest_group" . -}}
{{- $.Scratch.Add "guest-names" (slice .File.BaseFileName) -}}
{{- end -}}
{{- else -}}
{{- with .Params.Aka -}}
{{- $.Scratch.Add "guest-names" (slice $.File.BaseFileName) -}}
{{- range $names := . -}}
{{- if ne $names $.File.BaseFileName }}
{{- $.Scratch.Add "guest-names" (slice $names) -}}
{{- end -}}
{{- end -}}
{{- else -}}
{{ $.Scratch.Set "guest-names" (slice .File.BaseFileName) }}
{{- end -}}
{{- end -}}
<div class="list-group guest_episode_list">
{{ range $name := ($.Scratch.Get "guest-names") }}
{{- $.Scratch.Set "guest-name" $name -}}
{{- range $page := (where ( where site.RegularPages "Type" "in" site.Params.mainSections) ".Params.upcoming" "!=" true ) -}}
{{- range $page.Params.guests -}}
{{- if eq . ($.Scratch.Get "guest-name") -}}
{{ if and (isset $.Site.Params "episode_number_style") ($page.Params.episode)}}
{{ if eq $.Site.Params.episode_number_style "parens" }}
<a href="{{ $page.Permalink }}" class= "guest_page_episode_link list-group-item list-group-item-action">{{ $page.Title }} ({{ with $.Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ $page.Params.episode }})</a>
{{ else if eq $.Site.Params.episode_number_style "brackets" }}
<a href="{{ $page.Permalink }}" class= "guest_page_episode_link list-group-item list-group-item-action">{{ $page.Title }} [{{ with $.Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ $page.Params.episode }}]</a>
{{ else if eq $.Site.Params.episode_number_style "dash" }}
<a href="{{ $page.Permalink }}" class= "guest_page_episode_link list-group-item list-group-item-action">{{ $page.Title }} - {{ with $.Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ $page.Params.episode }}</a>
{{ else }}
<a href="{{ $page.Permalink }}" class= "guest_page_episode_link list-group-item list-group-item-action">{{ $page.Title }}</a>
{{ end }}
{{ else }}
<a href="{{ $page.Permalink }}" class= "guest_page_episode_link list-group-item list-group-item-action">{{ $page.Title }}</a>
{{ end }}
{{- end -}}<!-- if eq guest name-->
{{- end -}}<!-- range params guests -->
{{- end -}}<!--range episodes -->
{{- end -}}<!-- range -->
</div>
</div>
</div>
</div>
</div>
</div>
{{ end }}