Skip to content
This repository has been archived by the owner on Jul 8, 2021. It is now read-only.

footer navigation for nested sections #43

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 7 additions & 36 deletions layouts/partials/footer.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{{ if .IsPage }}
{{ if .Prev | or .Next }}
{{ if .PrevInSection | or .NextInSection }}
<nav class="pagination" aria-label="Footer">
<div class="previous">
{{ if .Prev }}
<a href="{{ .Prev.Permalink }}" title="{{ .Prev.Title }}">
{{ if .NextInSection }}
<a href="{{ .NextInSection.Permalink }}" title="{{ .NextInSection.Title }}">
<span class="direction">
Previous
</span>
Expand All @@ -13,7 +13,7 @@
</div>
<div class="stretch">
<div class="title">
{{ .Prev.Title }}
{{ .NextInSection.Title }}
</div>
</div>
</div>
Expand All @@ -22,15 +22,15 @@
</div>

<div class="next">
{{ if .Next }}
<a href="{{ .Next.Permalink }}" title="{{ .Next.Title }}">
{{ if .PrevInSection }}
<a href="{{ .PrevInSection.Permalink }}" title="{{ .PrevInSection.Title }}">
<span class="direction">
Next
</span>
<div class="page">
<div class="stretch">
<div class="title">
{{ .Next.Title }}
{{ .PrevInSection.Title }}
</div>
</div>
<div class="button button-next" role="button" aria-label="Next">
Expand All @@ -43,32 +43,3 @@
</nav>
{{ end }}
{{ end }}

{{ if .IsHome }}
{{ if gt (len .Site.Pages) 2 }}
<nav class="pagination" aria-label="Footer">
<div class="previous">
</div>

{{ $title := (index (.Site.Pages.ByDate) 1).Title }}
{{ $permalink := (index (.Site.Pages.ByDate) 1).Permalink }}
<div class="next">
<a href="{{ $permalink }}" title="{{ $title }}">
<span class="direction">
Next
</span>
<div class="page">
<div class="stretch">
<div class="title">
{{ $title }}
</div>
</div>
<div class="button button-next" role="button" aria-label="Next">
<i class="icon icon-forward"></i>
</div>
</div>
</a>
</div>
</nav>
{{ end }}
{{ end }}