Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mattstratton/castanet.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Reddington <791642+chrisreddington@users.noreply.github.com>2020-12-02 01:25:40 +0300
committerGitHub <noreply@github.com>2020-12-02 01:25:40 +0300
commit928e71dfb62456e047f7ce1116b7915ec9e68d14 (patch)
tree66d73fdbe8c0180ba58a3779aac0e86f7c929b7b /layouts
parent13c75136a240e30bb463bafbf6fdc4a6244ff17f (diff)
Add Functionality: Show next upcoming episode (#309)
Co-authored-by: Chris Reddington <chredd@microsoft.com> Co-authored-by: Matt Stratton <matt.stratton@hey.com>
Diffstat (limited to 'layouts')
-rw-r--r--layouts/partials/grid.html10
-rw-r--r--layouts/partials/row.html17
2 files changed, 24 insertions, 3 deletions
diff --git a/layouts/partials/grid.html b/layouts/partials/grid.html
index a369027..0c486b0 100644
--- a/layouts/partials/grid.html
+++ b/layouts/partials/grid.html
@@ -1,5 +1,15 @@
{{- partial "jumbotron.html" . }}
+{{ if and (and (isset .Site.Params "show_next_upcoming") (eq .Site.Params.show_next_upcoming "true")) (ge (len (where ( where site.RegularPages "Type" "in" site.Params.mainSections) ".Params.upcoming" "==" true )) 1) }}
+<div class="row up_next_container">
+ <div class="col-md-12">
+ {{ range first 1 (where ( where site.RegularPages "Type" "in" site.Params.mainSections).ByDate ".Params.upcoming" "==" true ) }}
+ Next Episode: <a href="{{ .Permalink }}">{{ .Title }}</a> - Scheduled for {{ dateFormat "Jan 2, 2006" .Date }}
+ {{ end }}
+ </div>
+</div>
+{{ end }}
+
<section class="episode-list">
<div class = "col episode-list-header">
diff --git a/layouts/partials/row.html b/layouts/partials/row.html
index da92323..d4f0d47 100644
--- a/layouts/partials/row.html
+++ b/layouts/partials/row.html
@@ -3,9 +3,19 @@
{{- partial "jumbotron.html" . }}
{{ end }}
{{ end }}
-<div class="row hero_container">
+{{ if and (and (isset .Site.Params "show_next_upcoming") (eq .Site.Params.show_next_upcoming "true")) (ge (len (where ( where site.RegularPages "Type" "in" site.Params.mainSections) ".Params.upcoming" "==" true )) 1) }}
+<div class="row up_next_container">
<div class="col-md-12">
+ {{ range first 1 (where ( where site.RegularPages "Type" "in" site.Params.mainSections).ByDate ".Params.upcoming" "==" true ) }}
+ Next Episode: <a href="{{ .Permalink }}">{{ .Title }}</a> - Scheduled for {{ dateFormat "Jan 2, 2006" .Date }}
+ {{ end }}
+ </div>
+</div>
+{{ end }}
+
+ <div class="row hero_container">
+ <div class="col-md-12">
<h2>
Latest Episode
</h2>
@@ -33,7 +43,7 @@
{{- 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>
+ <a href="{{ .Permalink }}" class = "row_latest_episode_title"><h2>{{ .Title }}</h2></a>
<small>Posted on {{ dateFormat "Monday, Jan 2, 2006" .Date }} {{ partial "episode-metadata.html" .}}</small>
</div>
</div>
@@ -52,7 +62,7 @@
{{- 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>
+ <a href="{{ .Permalink }}" class = "row_latest_episode_title"><h2>{{ .Title }}</h2></a>
<small>Posted on {{ dateFormat "Monday, Jan 2, 2006" .Date }} {{ partial "episode-metadata.html" .}}</small>
</div>
</div>
@@ -71,6 +81,7 @@
<div class = "row homepage_episode_row">
<div class = "col-md-12">
<a href="{{ .Permalink }}" class = "row_latest_episode_title"><h2>{{ .Title }}</h2></a>
+
<small>Posted on {{ dateFormat "Monday, Jan 2, 2006" .Date }} {{ partial "episode-metadata.html" .}}</small>
</div>
</div>