Skip to content

Commit

Permalink
Pagination Support (#8)
Browse files Browse the repository at this point in the history
* pagination support

* full pagination support
  • Loading branch information
LordMathis committed Jun 6, 2017
1 parent a4ea546 commit 951f1fe
Show file tree
Hide file tree
Showing 25 changed files with 32 additions and 1 deletion.
Empty file modified LICENSE.md 100644 → 100755
Empty file.
Empty file modified README.md 100644 → 100755
Empty file.
Empty file modified archetypes/default.md 100644 → 100755
Empty file.
Empty file modified exampleSite/config.toml 100644 → 100755
Empty file.
Empty file modified exampleSite/content/about.md 100644 → 100755
Empty file.
Empty file modified exampleSite/content/post/creating-a-new-theme.md 100644 → 100755
Empty file.
Empty file modified exampleSite/content/post/goisforlovers.md 100644 → 100755
Empty file.
Empty file modified exampleSite/content/post/hugoisforlovers.md 100644 → 100755
Empty file.
Empty file modified exampleSite/content/post/migrate-from-jekyll.md 100644 → 100755
Empty file.
Empty file modified exampleSite/static/profile.jpg 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified images/about.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed images/index.png
Binary file not shown.
Empty file modified images/posts.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified images/screenshot.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified images/tn.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified layouts/404.html 100644 → 100755
Empty file.
3 changes: 2 additions & 1 deletion layouts/_default/list.html 100644 → 100755
Expand Up @@ -16,7 +16,7 @@ <h1 id=>{{ .Title }}</h1>
</div>
</div>
<ul id="post-list">
{{ range .Data.Pages }}
{{ range .Paginator.Pages }}
<li>
<div class="post-list-item">
<div class="post-header">
Expand All @@ -32,6 +32,7 @@ <h4 class="post-date">{{ .Date.Format "Jan 2, 2006" }}</h4>
{{ end }}

</ul>
{{ partial "pagination" . }}
<div class="push"></div>
</div>
{{ partial "footer.html" . }}
Expand Down
Empty file modified layouts/_default/single.html 100644 → 100755
Empty file.
Empty file modified layouts/index.html 100644 → 100755
Empty file.
Empty file modified layouts/partials/footer.html 100644 → 100755
Empty file.
Empty file modified layouts/partials/head.html 100644 → 100755
Empty file.
Empty file modified layouts/partials/header.html 100644 → 100755
Empty file.
30 changes: 30 additions & 0 deletions layouts/partials/pagination.html
@@ -0,0 +1,30 @@
{{ $pag := $.Paginator }}
{{ if gt $pag.TotalPages 1 }}
<div class="pagination-wrapper text-center">
<ul class="pagination">
{{ with $pag.First }}
<li>
<a href="{{ .URL }}" aria-label="First"><span aria-hidden="true">&laquo;&laquo;</span></a>
</li>
{{ end }}
<li
{{ if not $pag.HasPrev }}class="disabled"{{ end }}>
<a href="{{ if $pag.HasPrev }}{{ $pag.Prev.URL }}{{ end }}" aria-label="Previous"><span aria-hidden="true">&laquo;</span></a>
</li>
{{ range $pag.Pagers }}
<li
{{ if eq . $pag }}class="active"{{ end }}><a href="{{ .URL }}">{{ .PageNumber }}</a></li>
{{ end }}
<li
{{ if not $pag.HasNext }}class="disabled"{{ end }}>
<a href="{{ if $pag.HasNext }}{{ $pag.Next.URL }}{{ end }}" aria-label="Next"><span aria-hidden="true">&raquo;</span></a>
</li>
{{ with $pag.Last }}
<li>
<a href="{{ .URL }}" aria-label="Last"><span aria-hidden="true">&raquo;&raquo;</span></a>
</li>
{{ end }}
</ul>
</div>
{{ end }}

Empty file modified static/css/nix.css 100644 → 100755
Empty file.
Empty file modified theme.toml 100644 → 100755
Empty file.

0 comments on commit 951f1fe

Please sign in to comment.