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

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbep <bjorn.erik.pedersen@gmail.com>2015-01-26 15:34:12 +0300
committerbep <bjorn.erik.pedersen@gmail.com>2015-01-26 15:34:12 +0300
commitc0fbe614843db9640b0ae2ee8dc7117c886cb6ed (patch)
tree0db902f6c96950424fe9bd750fd16a10ac5bee88
parent3628d0bbc608cca94cb239a88b7920c4c1b0e3a1 (diff)
Add Bootstrap-compatible pagination.html
See #750
-rw-r--r--tpl/template_embedded.go28
1 files changed, 28 insertions, 0 deletions
diff --git a/tpl/template_embedded.go b/tpl/template_embedded.go
index 111045535..d09ef8447 100644
--- a/tpl/template_embedded.go
+++ b/tpl/template_embedded.go
@@ -81,6 +81,34 @@ func (t *GoHtmlTemplate) EmbedTemplates() {
{{ end }}
</urlset>`)
+ t.AddInternalTemplate("", "pagination.html", `{{ $pag := .Paginator }}
+ {{ if gt $pag.TotalPages 1 }}
+ <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>
+ {{ end }}`)
+
t.AddInternalTemplate("", "disqus.html", `{{ if .Site.DisqusShortname }}<div id="disqus_thread"></div>
<script type="text/javascript">
var disqus_shortname = '{{ .Site.DisqusShortname }}';