{{ define "main" }}

{{ title .Title }}

Posted on {{ dateFormat "Monday, Jan 2, 2006" .Date }}
{{ if isset .Params "episode_banner" }} {{ if ne .Params.episode_banner "" }}
{{ .Description | markdownify }}
{{ end }} {{ else }} {{- if isset .Params "episode_image" -}} {{- if ne .Params.episode_image "" -}}
{{ .Description | markdownify }}
{{- end -}} {{- else -}}
{{ .Description | markdownify }}
{{- end -}} {{ end }} {{- with .Params.podcast_file -}}
{{- end -}} {{- with .Params.youtube -}}
{{- end -}} {{- with .Params.transcript -}}

Transcript

{{ (readFile .) | markdownify}}
{{- end -}}

Show Notes

{{ .Content }}
{{ with .Params.guests }}

Guests

{{ range $name := . }} {{ $.Scratch.Set "person" $name }} {{- range where $.Site.Pages "Type" "guest" -}} {{- if eq .File.BaseFileName ($.Scratch.Get "person") -}} {{- $.Scratch.Set "guest-exist" "true" -}}
{{- if and (isset .Params "thumbnail") (ne .Params.thumbnail "") -}} {{- if (eq (slicestr .Params.thumbnail 0 4) "http") -}} {{ .Title }} {{- else -}} {{ .Title }} {{- end -}} {{- else -}} {{ .Title }} {{- end -}}

{{ .Title }}

{{ .Content }} {{- with .Params.Website -}} {{- end -}} {{- with .Params.Twitter -}} {{- end -}} {{- with .Params.GitHub -}} {{- end -}} {{- with .Params.LinkedIn -}} {{- end -}} {{- with .Params.Facebook -}} {{- end -}} {{- with .Params.Pinterest -}} {{- end -}} {{- with .Params.Instagram -}} {{- end -}} {{- with .Params.YouTube -}} {{- end -}} {{- with .Params.Twitch -}} {{- end -}}
{{- $.Scratch.Set "guest-exist" "false" -}} {{- end -}} {{- end -}} {{- if ne ($.Scratch.Get "guest-exist") "true" -}} {{- if (isset $.Site.Data.guests ($.Scratch.Get "person")) -}} {{- $p := (index $.Site.Data.guests ($.Scratch.Get "person")) -}}
{{- if and (isset $p "thumbnail") (ne $p.thumbnail "") -}} {{- if (eq (slicestr $p.thumbnail 0 4) "http") -}} {{ $p.full_name }} {{- else -}} {{ $p.full_name }} {{- end -}} {{- else -}} {{ $p.full_name }} {{- end -}}

{{ $p.full_name }}

{{- if isset $p "bio" -}}

{{ $p.bio | markdownify }}

{{ end }} {{ if isset $p "homepage" }} {{ end }} {{ if isset $p "twitter" }} {{ end }} {{ if isset $p "github"}} {{ end }} {{ if isset $p "linkedin" }} {{ end }} {{ if isset $p "facebook" }} {{ end }}
{{ end }} {{ end }} {{ end }} {{ end }} {{ with .Params.hosts }}

Hosts

{{ range $name := . }} {{ $.Scratch.Set "person" $name }} {{- range where $.Site.Pages "Type" "host" -}} {{- if eq .File.BaseFileName ($.Scratch.Get "person") -}} {{- $.Scratch.Set "host-exist" "true" -}}
{{- if and (isset .Params "thumbnail") (ne .Params.thumbnail "") -}} {{- if (eq (slicestr .Params.thumbnail 0 4) "http") -}} {{ .Title }} {{- else -}} {{ .Title }} {{- end -}} {{- else -}} {{ .Title }} {{- end -}}

{{ .Title }}

{{ .Content }} {{- with .Params.Website -}} {{- end -}} {{- with .Params.Twitter -}} {{- end -}} {{- with .Params.GitHub -}} {{- end -}} {{- with .Params.LinkedIn -}} {{- end -}} {{- with .Params.Facebook -}} {{- end -}} {{- with .Params.Pinterest -}} {{- end -}} {{- with .Params.Instagram -}} {{- end -}} {{- with .Params.YouTube -}} {{- end -}} {{- with .Params.Twitch -}} {{- end -}}
{{- $.Scratch.Set "host-exist" "false" -}} {{- end -}} {{- end -}} {{ end }} {{ end }} {{- with .Params.sponsors -}}
{{- end -}} {{ range $sponsor :=.Params.sponsors }} {{ if isset $.Site.Data.sponsors $sponsor }} {{ $s := (index $.Site.Data.sponsors $sponsor) }}
{{ $sponsor }}

{{end}} {{end}} {{- with .Params.sponsors -}}
{{- end -}}
{{ with .Site.Params.disqusShortname }}
{{ partial "disqus.html" }}
{{ end }}
{{ end }}