-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for upcoming episodes (#297)
- Loading branch information
1 parent
120d700
commit 4a467b7
Showing
17 changed files
with
390 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
+++ | ||
date = "2016-09-25T02:11:48-05:00" | ||
description = "about this site" | ||
title = "Upcoming Episodes" | ||
+++ | ||
these are episodes that aren't published yet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
<section class="episode-list"> | ||
|
||
<div class = "col episode-list-header"> | ||
<h2 class = "episode-list-header">All Episodes</h2> | ||
</div> | ||
|
||
<div class = "row"> | ||
|
||
{{ $paginator := .Paginate (where ( where site.RegularPages "Type" "in" site.Params.mainSections) ".Params.upcoming" "==" true ) }} | ||
|
||
{{ range $paginator.Pages }} | ||
{{ $.Scratch.Set "episode" .File.BaseFileName }} | ||
<div class="col-md-4 grid_episode_col"> | ||
<div class="episode-image-homepage"> | ||
<a href="{{ .Permalink }}"> | ||
<img src="{{ .Params.episode_image | absURL }}" class="img-fluid" alt="{{ .Title }}" /> | ||
|
||
|
||
|
||
</a> | ||
</div> | ||
<div class="grid_episode_detail"> | ||
<a href="{{ .Permalink }}" class= "grid_episode_title"><h3>{{ title .Title }}</h3></a> | ||
<small class = "grid_episode_title">Scheduled for {{ dateFormat "Monday, Jan 2, 2006" .Date }}</small> | ||
</div> | ||
|
||
</div> | ||
{{ end }} | ||
|
||
|
||
</div> | ||
|
||
</section> | ||
{{ if gt $paginator.TotalPages 1 }} | ||
<div class = "row"> | ||
<div class = "col"> | ||
|
||
|
||
<nav class="pagination justify-content-center"> | ||
|
||
{{ $pag := $.Paginator }} | ||
{{ $window := $.Site.Params.paginateWindow | default 1 }} | ||
{{ if gt $pag.TotalPages 1 }} | ||
{{ $total := $pag.TotalPages }} | ||
{{ $size := add 5 (add $window $window) }} | ||
{{ $cur := $pag.PageNumber }} | ||
{{ if gt $total $size }} | ||
{{ if lt $cur (sub $size (add $window 1)) }} | ||
{{ $.Scratch.Set "show" (seq 1 (sub $size 2)) }} | ||
{{ else if lt (sub $total $cur) (sub $size (add $window 2)) }} | ||
{{ $.Scratch.Set "show" (seq (add (sub $total $size) 3) $total) }} | ||
{{ else }} | ||
{{ $.Scratch.Set "show" (seq (sub $cur $window) (add $cur $window)) }} | ||
{{ end }} | ||
{{ $.Scratch.Add "show" 1 }} | ||
{{ $.Scratch.Add "show" $total }} | ||
{{ else }} | ||
{{ $.Scratch.Set "show" (seq 1 $total) }} | ||
{{ end }} | ||
|
||
<ul class="pagination pagination-lg"> | ||
<!-- first page button --> | ||
{{if $paginator.HasPrev }} | ||
{{ if gt $paginator.PageNumber 2 }} | ||
{{- with $paginator.First -}} | ||
{{- $url := trim (string .URL) "/" | absURL -}} | ||
<li class="page-item"> | ||
<a href="{{ $url }}" aria-label="First" class="page-link"><span aria-hidden="true">««</span></a> | ||
</li> | ||
{{- end -}} | ||
{{ end }} | ||
{{ end }} | ||
|
||
|
||
<!-- prev page button --> | ||
{{- with $paginator.HasPrev -}} | ||
<li class="page-item"> | ||
<a href="{{ $paginator.Prev.URL }}" class="page-link"> « </a> | ||
</li> | ||
{{ end }} | ||
|
||
<!-- page # buttons --> | ||
{{ range $pag.Pagers }} | ||
{{ $cur := .PageNumber }} | ||
{{- $url := trim (string $.URL) "/" | absURL -}} | ||
{{ if in ($.Scratch.Get "show") $cur }} | ||
<li class = "{{ if eq . $pag }}active{{ end }} page-item"><a href="{{ .URL }}" class="page-link hidden-md-down">{{ .PageNumber }}</a></li> | ||
{{ else if in (slice 2 (sub $total 1)) $cur }} | ||
<li class="disabled page-item"><a name="" class="page-link hidden-md-down">…</a></li> | ||
{{ end }} | ||
{{ end }} | ||
|
||
<!-- next page button --> | ||
{{- with $paginator.HasNext -}} | ||
<li class="page-item"> | ||
<a href="{{ $paginator.Next.URL }}" class="page-link"> » </a> | ||
</li> | ||
{{ end }} | ||
|
||
<!-- last page button --> | ||
{{ if lt $paginator.PageNumber (sub $paginator.TotalPages 1) }} | ||
{{- with $paginator.Last -}} | ||
{{- $url := trim (string .URL) "/" | absURL -}} | ||
<li class="page-item"> | ||
<a href="{{ $url }}" aria-label="Last" class="page-link"><span aria-hidden="true">»»</span></a> | ||
</li> | ||
{{- end -}} | ||
{{ end }} | ||
|
||
</ul> | ||
{{ end }} | ||
</nav> | ||
</div> | ||
</div> | ||
{{ end }} | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.