diff options
author | mblum <me@mblum.me> | 2017-07-09 07:11:42 +0300 |
---|---|---|
committer | mblum <me@mblum.me> | 2017-07-09 07:11:42 +0300 |
commit | 4d07890aa48db22cd475e12fe0fa6a5efbe95300 (patch) | |
tree | 16e2f654d1c35a88867b152854a854519f5d4f70 | |
parent | a0260d5c2e75b0f1fb1295842cf7a22c517a152d (diff) |
Prev / Next pagination within sections (posts / projects / dashboards)
-rw-r--r-- | layouts/_default/list.html | 2 | ||||
-rw-r--r-- | layouts/_default/single.html | 1 | ||||
-rw-r--r-- | layouts/partials/paginate-list.html (renamed from layouts/partials/paginate.html) | 4 | ||||
-rw-r--r-- | layouts/partials/paginate-single.html | 14 | ||||
-rw-r--r-- | layouts/project/list.html | 2 |
5 files changed, 18 insertions, 5 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html index ec207ba..7ba9774 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -15,5 +15,5 @@ {{ end }} </section> </div> -{{ partial "paginate" . }} +{{ partial "paginate-list" . }} {{ partial "footer" . }}
\ No newline at end of file diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 020b63c..232af66 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -15,4 +15,5 @@ </div> </section> </div> +{{ partial "paginate-single" . }} {{ partial "footer" . }}
\ No newline at end of file diff --git a/layouts/partials/paginate.html b/layouts/partials/paginate-list.html index ec980e1..87c4a49 100644 --- a/layouts/partials/paginate.html +++ b/layouts/partials/paginate-list.html @@ -11,6 +11,4 @@ <button type="button" class="btn btn-secondary pull-left disabled">Next <i class="fa fa-chevron-right" aria-hidden="true"></i></button> {{ end }} </div> -</div> - -
\ No newline at end of file +</div>
\ No newline at end of file diff --git a/layouts/partials/paginate-single.html b/layouts/partials/paginate-single.html new file mode 100644 index 0000000..c311008 --- /dev/null +++ b/layouts/partials/paginate-single.html @@ -0,0 +1,14 @@ +<div class="container"> + <div class="pagination"> + {{ if .PrevInSection }} + <button type="button" class="btn btn-secondary pull-right"><a href="{{ .PrevInSection.Permalink }}"><i class="fa fa-chevron-left" aria-hidden="true"></i> Previous</a></button> + {{ else }} + <button type="button" class="btn btn-secondary pull-left disabled"><i class="fa fa-chevron-left" aria-hidden="true"></i> Previous</button> + {{ end }} + {{ if .NextInSection }} + <button type="button" class="btn btn-secondary pull-right"><a href="{{ .NextInSection.Permalink }}">Next <i class="fa fa-chevron-right" aria-hidden="true"></i></a></button> + {{ else }} + <button type="button" class="btn btn-secondary pull-left disabled">Next <i class="fa fa-chevron-right" aria-hidden="true"></i></button> + {{ end }} + </div> +</div>
\ No newline at end of file diff --git a/layouts/project/list.html b/layouts/project/list.html index b4d2e47..e83e0e3 100644 --- a/layouts/project/list.html +++ b/layouts/project/list.html @@ -21,5 +21,5 @@ {{ end }} </section> </div> -{{ partial "paginate" . }} +{{ partial "paginate-list" . }} {{ partial "footer" . }}
\ No newline at end of file |