Initial checkin
This commit is contained in:
.gitattributes.gitignore
archetypes
config.tomlcontent
push.shstatic
themes/hugo-theme-notrack
.gitignoreLICENSE.mdREADME.mdtheme.toml
archetypes
data
notrack
exampleSite
.gitmodules
archetypes
config.tomlcontent
static
images
layouts
404.html
_default
home.htmlpartials
blog-entry-summary.htmlblog-taxonomy-info.htmlfooter.htmlhead.htmlheader.htmlpagination.htmlpost-category-link.htmlpost-tag-link.html
shortcodes
contact-box.htmlcontainer.htmlgallery-category.htmlgallery-modal.htmlgallery-photo.htmlgallery-script.htmlimage.htmlrawhtml.htmlresume-category.htmlresume-entry.htmlresume-section.htmlsocial.htmlvideo.html
taxonomy
static
css
fonts
FreeMono.woffFreeMonoBold.woffFreeMonoBoldOblique.woffFreeMonoOblique.woffFreeSans-small.woffFreeSans.woffFreeSansBold-small.woffFreeSansBold.woffFreeSansBoldOblique.woffFreeSansOblique.woffFreeSerif-small.woffFreeSerif.woffFreeSerifBold-small.woffFreeSerifBold.woffFreeSerifBoldItalic-small.woffFreeSerifBoldItalic.woffFreeSerifItalic-small.woffFreeSerifItalic.wofffa-brands-400.woff2fa-solid-900.woff2mononoki-Bold.woff2mononoki-BoldItalic.woff2mononoki-Italic.woff2mononoki-Regular.woff2
js
43
themes/hugo-theme-notrack/layouts/partials/pagination.html
Normal file
43
themes/hugo-theme-notrack/layouts/partials/pagination.html
Normal file
@ -0,0 +1,43 @@
|
||||
{{ $pag := $.Paginator }}
|
||||
{{ if gt $pag.TotalPages 1 }}
|
||||
<ul class="pagination">
|
||||
{{ with $pag.First }}
|
||||
<li class="page-item">
|
||||
<a href="{{ .URL }}" class="page-link" aria-label="First"><span
|
||||
aria-hidden="true">«</span></a>
|
||||
</li>
|
||||
{{ end }}
|
||||
<li class="page-item{{ if not $pag.HasPrev }} disabled{{ end }}">
|
||||
<a {{ if $pag.HasPrev }}href="{{ $pag.Prev.URL }}"{{ end }}
|
||||
class="page-link" aria-label="Previous"><span aria-hidden="true">‹</span></a>
|
||||
</li>
|
||||
{{ $ellipsed := false }}
|
||||
{{ $shouldEllipse := false }}
|
||||
{{ range $pag.Pagers }}
|
||||
{{ $right := sub .TotalPages .PageNumber }}
|
||||
{{ $showNumber := or (le .PageNumber 3) (eq $right 0) }}
|
||||
{{ $showNumber := or $showNumber (and (gt .PageNumber (sub $pag.PageNumber 2)) (lt .PageNumber (add $pag.PageNumber 2))) }}
|
||||
{{ if $showNumber }}
|
||||
{{ $ellipsed = false }}
|
||||
{{ $shouldEllipse = false }}
|
||||
{{ else }}
|
||||
{{ $shouldEllipse = not $ellipsed }}
|
||||
{{ $ellipsed = true }}
|
||||
{{ end }}
|
||||
{{ if $showNumber }}
|
||||
<li class="page-item{{ if eq . $pag }} active{{ end }}"><a class="page-link" href="{{ .URL }}">{{ .PageNumber }}</a></li>
|
||||
{{ else if $shouldEllipse }}
|
||||
<li class="page-item disabled"><span aria-hidden="true"> … </span></li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<li class="page-item{{ if not $pag.HasNext }} disabled{{ end }}">
|
||||
<a {{ if $pag.HasNext }}href="{{ $pag.Next.URL }}"{{ end }}
|
||||
class="page-link" aria-label="Next"><span aria-hidden="true">›</span></a>
|
||||
</li>
|
||||
{{ with $pag.Last }}
|
||||
<li class="page-item">
|
||||
<a href="{{ .URL }}" class="page-link" aria-label="Last"><span aria-hidden="true">»</span></a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
Reference in New Issue
Block a user