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:
authorMatt Stratton <matt.stratton@gmail.com>2017-04-21 20:38:02 +0300
committerMatt Stratton <matt.stratton@gmail.com>2017-04-21 20:38:02 +0300
commitf9682a81c46ed1993e8c135f4092cd9452d12071 (patch)
tree39733e86c4c0046b1333764ef39f0f7ca91ec1b6
parentae70a4021520ba06c81e049b5ad72ce96d659fb0 (diff)
Check for single episode
This allows for only one episode existing. Fixes #44.
-rw-r--r--layouts/index.html4
1 files changed, 4 insertions, 0 deletions
diff --git a/layouts/index.html b/layouts/index.html
index 057128c..7f47632 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -35,8 +35,11 @@
<!-- rest of episodes -->
+{{ $list := (where .Data.Pages "Type" "episode") }}
+{{ $len := (len $list)}}
<div class="row main_container">
<div class="col-md-8">
+ {{ if gt $len 1 }}
{{ $paginator := .Paginate (after 1 (where .Data.Pages "Type" "episode")) 5 }}
{{ range $paginator.Pages }}
<div class = "row homepage_episode_row">
@@ -63,6 +66,7 @@
</div>
{{ end }}
+ {{ end }}
</div>
<div class="col-md-4 sidebar_col">
{{ partial "sidebar.html" . }}