diff options
author | Chris Reddington <791642+chrisreddington@users.noreply.github.com> | 2020-12-23 00:07:39 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-23 00:07:39 +0300 |
commit | 3db321ad112b90636d30e0cb5ed587d0bd20219a (patch) | |
tree | aa862e9fc8d85e01edf7d134fb3bdfef58b920b6 /layouts | |
parent | 7d7d88c4fa334036b52612b1262c117dc589404e (diff) |
Add episode numbers/prefix in RSS and Relevant Titles/Links [Attempt #2] (#322)
* Attempt #2 at title changes
Signed-off-by: Chris Reddington <791642+chrisreddington@users.noreply.github.com>
* Tweaks to conditional based on review.
Signed-off-by: Chris Reddington <791642+chrisreddington@users.noreply.github.com>
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/episode/single.html | 16 | ||||
-rw-r--r-- | layouts/guest/single.html | 14 | ||||
-rw-r--r-- | layouts/host/single.html | 14 | ||||
-rw-r--r-- | layouts/partials/grid-taxonomy.html | 14 | ||||
-rw-r--r-- | layouts/partials/grid-upcoming.html | 16 | ||||
-rw-r--r-- | layouts/partials/grid.html | 14 | ||||
-rw-r--r-- | layouts/partials/row-taxonomy.html | 16 | ||||
-rw-r--r-- | layouts/partials/row-upcoming.html | 14 | ||||
-rw-r--r-- | layouts/partials/row.html | 42 | ||||
-rw-r--r-- | layouts/section/episode.rss.xml | 16 |
10 files changed, 160 insertions, 16 deletions
diff --git a/layouts/episode/single.html b/layouts/episode/single.html index cd57805..58b894e 100644 --- a/layouts/episode/single.html +++ b/layouts/episode/single.html @@ -1,8 +1,20 @@ {{ define "main" }} <div class="row"> - <div class="col"> - <h1>{{ title .Title }}</h1> + <div class="col"> + {{ if and (isset .Site.Params "episode_number_style") (.Params.episode) }} + {{ if eq .Site.Params.episode_number_style "parens" }} + <h1>{{ title .Title }} ({{ with .Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ .Params.episode }})</h1> + {{ else if eq .Site.Params.episode_number_style "brackets" }} + <h1>{{ title .Title }} [{{ with .Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ .Params.episode }}]</h1> + {{ else if eq .Site.Params.episode_number_style "dash" }} + <h1>{{ title .Title }} - {{ with .Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ .Params.episode }}</h1> + {{ else }} + <h1>{{ title .Title }}</h1> + {{ end }} + {{ else }} + <h1>{{ title .Title }}</h1> + {{ end }} {{- if ne $.Params.upcoming true -}} <small>Posted on {{ dateFormat "Monday, Jan 2, 2006" .Date }} {{ partial "episode-metadata.html" .}}</small> {{- else -}} diff --git a/layouts/guest/single.html b/layouts/guest/single.html index 594811a..f058f60 100644 --- a/layouts/guest/single.html +++ b/layouts/guest/single.html @@ -108,7 +108,19 @@ {{- range $page := (where ( where site.RegularPages "Type" "in" site.Params.mainSections) ".Params.upcoming" "!=" true ) -}} {{- range $page.Params.guests -}} {{- if eq . ($.Scratch.Get "guest-name") -}} - <a href = "{{$page.Permalink}}" class = "guest_page_episode_link list-group-item list-group-item-action">{{$page.Title}}</a> + {{ 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 --> diff --git a/layouts/host/single.html b/layouts/host/single.html index 5d3ea3f..92d42a9 100644 --- a/layouts/host/single.html +++ b/layouts/host/single.html @@ -87,7 +87,19 @@ {{ range $page := (where ( where site.RegularPages "Type" "in" site.Params.mainSections) ".Params.upcoming" "!=" true ) }} {{ range $page.Params.hosts }} {{ if eq . ($.Scratch.Get "host-name") }} - <a href = "{{$page.Permalink}}" class = "guest_page_episode_link list-group-item list-group-item-action">{{$page.Title}}</a> + {{ 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 }} {{ end }} {{ end }} diff --git a/layouts/partials/grid-taxonomy.html b/layouts/partials/grid-taxonomy.html index bfe0b17..086bdda 100644 --- a/layouts/partials/grid-taxonomy.html +++ b/layouts/partials/grid-taxonomy.html @@ -20,7 +20,19 @@ </a> </div> <div class="grid_episode_detail"> - <a href="{{ .Permalink }}" class= "grid_episode_title"><h3>{{ title .Title }}</h3></a> + {{ if and (isset .Site.Params "episode_number_style") (.Params.episode) }} + {{ if eq .Site.Params.episode_number_style "parens" }} + <h3><a href="{{ .Permalink }}" class= "grid_episode_title">{{ .Title }}</a> ({{ with .Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ .Params.episode }})</h3> + {{ else if eq .Site.Params.episode_number_style "brackets" }} + <h3><a href="{{ .Permalink }}" class= "grid_episode_title">{{ .Title }}</a> [{{ with .Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ .Params.episode }}]</h3> + {{ else if eq .Site.Params.episode_number_style "dash" }} + <h3><a href="{{ .Permalink }}" class= "grid_episode_title">{{ .Title }}</a> - {{ with .Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ .Params.episode }}</h3> + {{ else }} + <h3><a href="{{ .Permalink }}" class= "grid_episode_title">{{ .Title }}</a> ({{ with .Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ .Params.episode }})</h3> + {{ end }} + {{ else }} + <h3><a href="{{ .Permalink }}" class= "grid_episode_title">{{ .Title }}</a></h3> + {{ end }} <small class = "grid_episode_title">Posted on {{ dateFormat "Monday, Jan 2, 2006" .Date }} {{ partial "episode-metadata.html" .}}</small> </div> diff --git a/layouts/partials/grid-upcoming.html b/layouts/partials/grid-upcoming.html index 4c72ea4..6db7a17 100644 --- a/layouts/partials/grid-upcoming.html +++ b/layouts/partials/grid-upcoming.html @@ -19,8 +19,20 @@ </a> </div> - <div class="grid_episode_detail"> - <a href="{{ .Permalink }}" class= "grid_episode_title"><h3>{{ title .Title }}</h3></a> + <div class="grid_episode_detail"> + {{ if and (isset .Site.Params "episode_number_style") (.Params.episode) }} + {{ if eq .Site.Params.episode_number_style "parens" }} + <h3><a href="{{ .Permalink }}" class= "grid_episode_title">{{ .Title }}</a> ({{ with .Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ .Params.episode }})</h3> + {{ else if eq .Site.Params.episode_number_style "brackets" }} + <h3><a href="{{ .Permalink }}" class= "grid_episode_title">{{ .Title }}</a> [{{ with .Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ .Params.episode }}]</h3> + {{ else if eq .Site.Params.episode_number_style "dash" }} + <h3><a href="{{ .Permalink }}" class= "grid_episode_title">{{ .Title }}</a> - {{ with .Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ .Params.episode }}</h3> + {{ else }} + <h3><a href="{{ .Permalink }}" class= "grid_episode_title">{{ .Title }}</a> ({{ with .Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ .Params.episode }})</h3> + {{ end }} + {{ else }} + <h3><a href="{{ .Permalink }}" class= "grid_episode_title">{{ .Title }}</a></h3> + {{ end }} <small class = "grid_episode_title">Scheduled for {{ dateFormat "Monday, Jan 2, 2006" .Date }} {{ partial "episode-metadata.html" .}}</small> </div> diff --git a/layouts/partials/grid.html b/layouts/partials/grid.html index 0c486b0..e691a29 100644 --- a/layouts/partials/grid.html +++ b/layouts/partials/grid.html @@ -32,7 +32,19 @@ </a> </div> <div class="grid_episode_detail"> - <a href="{{ .Permalink }}" class= "grid_episode_title"><h3>{{ title .Title }}</h3></a> + {{ if and (isset .Site.Params "episode_number_style") (.Params.episode) }} + {{ if eq .Site.Params.episode_number_style "parens" }} + <h3><a href="{{ .Permalink }}" class= "grid_episode_title">{{ .Title }}</a> ({{ with .Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ .Params.episode }})</h3> + {{ else if eq .Site.Params.episode_number_style "brackets" }} + <h3><a href="{{ .Permalink }}" class= "grid_episode_title">{{ .Title }}</a> [{{ with .Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ .Params.episode }}]</h3> + {{ else if eq .Site.Params.episode_number_style "dash" }} + <h3><a href="{{ .Permalink }}" class= "grid_episode_title">{{ .Title }}</a> - {{ with .Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ .Params.episode }}</h3> + {{ else }} + <h3><a href="{{ .Permalink }}" class= "grid_episode_title">{{ .Title }}</a> ({{ with .Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ .Params.episode }})</h3> + {{ end }} + {{ else }} + <h3><a href="{{ .Permalink }}" class= "grid_episode_title">{{ .Title }}</a></h3> + {{ end }} <small class = "grid_episode_title">Posted on {{ dateFormat "Monday, Jan 2, 2006" .Date }} {{ partial "episode-metadata.html" .}}</small> </div> diff --git a/layouts/partials/row-taxonomy.html b/layouts/partials/row-taxonomy.html index 00f706a..4a75f20 100644 --- a/layouts/partials/row-taxonomy.html +++ b/layouts/partials/row-taxonomy.html @@ -25,8 +25,20 @@ {{- end -}} {{- end -}} <div class = "row homepage_episode_row"> - <div class = "col-md-12"> - <a href="{{ .Permalink }}" class= "grid_episode_title"><h3 class= "grid_episode_title">{{ .Title }}</h3></a> + <div class = "col-md-12"> + {{ if and (isset .Site.Params "episode_number_style") (.Params.episode) }} + {{ if eq .Site.Params.episode_number_style "parens" }} + <h3><a href="{{ .Permalink }}" class= "grid_episode_title">{{ .Title }}</a> ({{ with .Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ .Params.episode }})</h3> + {{ else if eq .Site.Params.episode_number_style "brackets" }} + <h3><a href="{{ .Permalink }}" class= "grid_episode_title">{{ .Title }}</a> [{{ with .Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ .Params.episode }}]</h3> + {{ else if eq .Site.Params.episode_number_style "dash" }} + <h3><a href="{{ .Permalink }}" class= "grid_episode_title">{{ .Title }}</a> - {{ with .Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ .Params.episode }}</h3> + {{ else }} + <h3><a href="{{ .Permalink }}" class= "grid_episode_title">{{ .Title }}</a> ({{ with .Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ .Params.episode }})</h3> + {{ end }} + {{ else }} + <h3><a href="{{ .Permalink }}" class= "grid_episode_title">{{ .Title }}</a></h3> + {{ end }} <small>Posted on {{ dateFormat "Monday, Jan 2, 2006" .Date }} {{ partial "episode-metadata.html" .}}</small> </div> </div> diff --git a/layouts/partials/row-upcoming.html b/layouts/partials/row-upcoming.html index 5ddacdf..451c33c 100644 --- a/layouts/partials/row-upcoming.html +++ b/layouts/partials/row-upcoming.html @@ -26,7 +26,19 @@ {{- end -}} <div class = "row homepage_episode_row"> <div class = "col-md-12"> - <a href="{{ .Permalink }}" class= "grid_episode_title"><h3 class= "grid_episode_title">{{ .Title }}</h3></a> + {{ if and (isset .Site.Params "episode_number_style") (.Params.episode) }} + {{ if eq .Site.Params.episode_number_style "parens" }} + <h3><a href="{{ .Permalink }}" class= "grid_episode_title">{{ .Title }}</a> ({{ with .Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ .Params.episode }})</h3> + {{ else if eq .Site.Params.episode_number_style "brackets" }} + <h3><a href="{{ .Permalink }}" class= "grid_episode_title">{{ .Title }}</a> [{{ with .Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ .Params.episode }}]</h3> + {{ else if eq .Site.Params.episode_number_style "dash" }} + <h3><a href="{{ .Permalink }}" class= "grid_episode_title">{{ .Title }}</a> - {{ with .Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ .Params.episode }}</h3> + {{ else }} + <h3><a href="{{ .Permalink }}" class= "grid_episode_title">{{ .Title }}</a> ({{ with .Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ .Params.episode }})</h3> + {{ end }} + {{ else }} + <h3><a href="{{ .Permalink }}" class= "grid_episode_title">{{ .Title }}</a></h3> + {{ end }} <small>Scheduled for {{ dateFormat "Monday, Jan 2, 2006" .Date }} {{ partial "episode-metadata.html" .}}</small> </div> </div> diff --git a/layouts/partials/row.html b/layouts/partials/row.html index d4f0d47..a4a42ed 100644 --- a/layouts/partials/row.html +++ b/layouts/partials/row.html @@ -43,7 +43,19 @@ {{- if eq ($.Scratch.Get "youtube") "true" -}} <div class = "row homepage_episode_row"> <div class = "col"> - <a href="{{ .Permalink }}" class = "row_latest_episode_title"><h2>{{ .Title }}</h2></a> + {{ if and (isset .Site.Params "episode_number_style") (.Params.episode) }} + {{ if eq .Site.Params.episode_number_style "parens" }} + <h2><a href="{{ .Permalink }}" class= "row_latest_episode_title">{{ .Title }}</a> ({{ with .Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ .Params.episode }})</h2> + {{ else if eq .Site.Params.episode_number_style "brackets" }} + <h2><a href="{{ .Permalink }}" class= "row_latest_episode_title">{{ .Title }}</a> [{{ with .Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ .Params.episode }}]</h2> + {{ else if eq .Site.Params.episode_number_style "dash" }} + <h2><a href="{{ .Permalink }}" class= "row_latest_episode_title">{{ .Title }}</a> - {{ with .Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ .Params.episode }}</h2> + {{ else }} + <h2><a href="{{ .Permalink }}" class= "row_latest_episode_title">{{ .Title }}</a> ({{ with .Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ .Params.episode }})</h2> + {{ end }} + {{ else }} + <h2><a href="{{ .Permalink }}" class= "row_latest_episode_title">{{ .Title }}</a></h2> + {{ end }} <small>Posted on {{ dateFormat "Monday, Jan 2, 2006" .Date }} {{ partial "episode-metadata.html" .}}</small> </div> </div> @@ -62,7 +74,19 @@ {{- else if eq ($.Scratch.Get "episode_banner") "true" -}} <div class = "row homepage_episode_row"> <div class = "col"> - <a href="{{ .Permalink }}" class = "row_latest_episode_title"><h2>{{ .Title }}</h2></a> + {{ if and (isset .Site.Params "episode_number_style") (.Params.episode) }} + {{ if eq .Site.Params.episode_number_style "parens" }} + <h2><a href="{{ .Permalink }}" class= "row_latest_episode_title">{{ .Title }}</a> ({{ with .Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ .Params.episode }})</h2> + {{ else if eq .Site.Params.episode_number_style "brackets" }} + <h2><a href="{{ .Permalink }}" class= "row_latest_episode_title">{{ .Title }}</a> [{{ with .Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ .Params.episode }}]</h2> + {{ else if eq .Site.Params.episode_number_style "dash" }} + <h2><a href="{{ .Permalink }}" class= "row_latest_episode_title">{{ .Title }}</a> - {{ with .Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ .Params.episode }}</h2> + {{ else }} + <h2><a href="{{ .Permalink }}" class= "row_latest_episode_title">{{ .Title }}</a> ({{ with .Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ .Params.episode }})</h2> + {{ end }} + {{ else }} + <h2><a href="{{ .Permalink }}" class= "row_latest_episode_title">{{ .Title }}</a></h2> + {{ end }} <small>Posted on {{ dateFormat "Monday, Jan 2, 2006" .Date }} {{ partial "episode-metadata.html" .}}</small> </div> </div> @@ -149,7 +173,19 @@ {{- end -}} <div class = "row homepage_episode_row"> <div class = "col-md-12"> - <a href="{{ .Permalink }}" class= "grid_episode_title"><h3 class= "grid_episode_title">{{ .Title }}</h3></a> + {{ if and (isset .Site.Params "episode_number_style") (.Params.episode) }} + {{ if eq .Site.Params.episode_number_style "parens" }} + <h3><a href="{{ .Permalink }}" class= "grid_episode_title">{{ .Title }}</a> ({{ with .Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ .Params.episode }})</h3> + {{ else if eq .Site.Params.episode_number_style "brackets" }} + <h3><a href="{{ .Permalink }}" class= "grid_episode_title">{{ .Title }}</a> [{{ with .Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ .Params.episode }}]</h3> + {{ else if eq .Site.Params.episode_number_style "dash" }} + <h3><a href="{{ .Permalink }}" class= "grid_episode_title">{{ .Title }}</a> - {{ with .Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ .Params.episode }}</h3> + {{ else }} + <h3><a href="{{ .Permalink }}" class= "grid_episode_title">{{ .Title }}</a> ({{ with .Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ .Params.episode }})</h3> + {{ end }} + {{ else }} + <h3><a href="{{ .Permalink }}" class= "grid_episode_title">{{ .Title }}</a></h3> + {{ end }} <small>Posted on {{ dateFormat "Monday, Jan 2, 2006" .Date }} {{ partial "episode-metadata.html" .}}</small> </div> </div> diff --git a/layouts/section/episode.rss.xml b/layouts/section/episode.rss.xml index d9a6006..3f4e4ed 100644 --- a/layouts/section/episode.rss.xml +++ b/layouts/section/episode.rss.xml @@ -52,8 +52,20 @@ <generator>Hugo -- gohugo.io</generator> {{- range (where ( where .Site.Pages "Type" "episode") ".Params.upcoming" "!=" true) -}} {{ if isset .Params "podcast_file" }} - <item> - <title>{{ title .Title }}</title> + <item> + {{ if and (isset .Site.Params "episode_number_style") (.Params.episode) }} + {{ if eq .Site.Params.episode_number_style "parens" }} + <title>{{ title .Title }} ({{ with .Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ .Params.episode }})</title> + {{ else if eq .Site.Params.episode_number_style "brackets" }} + <title>{{ title .Title }} [{{ with .Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ .Params.episode }}]</title> + {{ else if eq .Site.Params.episode_number_style "dash" }} + <title>{{ title .Title }} - {{ with .Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ .Params.episode }}</title> + {{ else }} + <title>{{ title .Title }}</title> + {{ end }} + {{ else }} + <h1>{{ title .Title }}</h1> + {{ end }} <link>{{ .Permalink }}</link> <pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} </pubDate> <dc:creator>{{ .Site.Params.itunes_author }}</dc:creator> |