Skip to content

Commit

Permalink
Create a partial for my next/gallery/previous nav bar.
Browse files Browse the repository at this point in the history
  • Loading branch information
RoninTech committed Jun 19, 2023
1 parent 2228534 commit 5bd4c01
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 58 deletions.
60 changes: 2 additions & 58 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,66 +48,10 @@ <h1 class="f1 athelas mt3 mb1">
{{ end }}
</header>
<div class="nested-copy-line-height lh-copy {{ $.Param "post_content_classes" | default "serif"}} f5 nested-links {{ $.Param "text_color" | default "mid-gray" }} {{ cond (eq $.Site.Language.LanguageDirection "rtl") "pl4-l" "pr4-l" }}">
<hr>
<table style="width:100%">
<tr>
<td style="text-align:left"><b>Previous</b></td>
{{ if .Params.album }}
<td rowspan="2" style="text-align:left"><a href="{{ .Params.album }}" target=”_blank”><img src="/images/image-gallery.png" title="{{ .Params.title }} Photo Album" alt="{{ .Params.title }} Photo Album" height="50"></a></td>
{{ end }}
<td style="text-align:right"><b>Next</b></td>
</tr>
<tr>
<td style="text-align:left">
{{ with .PrevInSection }}
<a style="text-decoration: none" href="{{ .RelPermalink }}">{{ .Title }}</a>
{{ else }}
{{ $lastInSection := index (last 1 .CurrentSection.Pages.ByPublishDate) 0 }}
<a style="text-decoration: none" href="{{ $lastInSection.RelPermalink }}">{{ $lastInSection.Title }}</a>
{{ end }}
</td>
<td style="text-align:right">
{{ with .NextInSection }}
<a style="text-decoration: none" href="{{ .RelPermalink }}">{{ .Title }}</a>
{{ else }}
{{ $firstInSection := index (first 1 .CurrentSection.Pages.ByPublishDate) 0 }}
<a style="text-decoration: none" href="{{ $firstInSection.RelPermalink }}">{{ $firstInSection.Title }}</a>
{{ end }}
</td>
</tr>
</table>
<hr>
{{ partial "next-gallery-prev-navbar.html" . }}
{{- .Content -}}
{{- partial "tags.html" . -}}
<hr>
<table style="width:100%">
<tr>
<td style="text-align:left"><b>Previous</b></td>
{{ if .Params.album }}
<td rowspan="2" style="text-align:left"><a href="{{ .Params.album }}" target=”_blank”><img src="/images/image-gallery.png" title="{{ .Params.title }} Photo Album" alt="{{ .Params.title }} Photo Album" height="50"></a></td>
{{ end }}
<td style="text-align:right"><b>Next</b></td>
</tr>
<tr>
<td style="text-align:left">
{{ with .PrevInSection }}
<a style="text-decoration: none" href="{{ .RelPermalink }}">{{ .Title }}</a>
{{ else }}
{{ $lastInSection := index (last 1 .CurrentSection.Pages.ByPublishDate) 0 }}
<a style="text-decoration: none" href="{{ $lastInSection.RelPermalink }}">{{ $lastInSection.Title }}</a>
{{ end }}
</td>
<td style="text-align:right">
{{ with .NextInSection }}
<a style="text-decoration: none" href="{{ .RelPermalink }}">{{ .Title }}</a>
{{ else }}
{{ $firstInSection := index (first 1 .CurrentSection.Pages.ByPublishDate) 0 }}
<a style="text-decoration: none" href="{{ $firstInSection.RelPermalink }}">{{ $firstInSection.Title }}</a>
{{ end }}
</td>
</tr>
</table>
<hr>
{{ partial "next-gallery-prev-navbar.html" . }}
<div class="mt6 instapaper_ignoref">
{{ if .Site.DisqusShortname }}
{{ template "_internal/disqus.html" . }}
Expand Down
29 changes: 29 additions & 0 deletions layouts/partials/next-gallery-prev-navbar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<hr>
<table style="width:100%">
<tr>
<td style="text-align:left"><b>Previous</b></td>
{{ if .Params.album }}
<td rowspan="2" style="text-align:left"><a href="{{ .Params.album }}" target=”_blank”><img src="/images/image-gallery.png" title="{{ .Params.title }} Photo Album" alt="{{ .Params.title }} Photo Album" height="50"></a></td>
{{ end }}
<td style="text-align:right"><b>Next</b></td>
</tr>
<tr>
<td style="text-align:left">
{{ with .PrevInSection }}
<a style="text-decoration: none" href="{{ .RelPermalink }}">{{ .Title }}</a>
{{ else }}
{{ $lastInSection := index (last 1 .CurrentSection.Pages.ByPublishDate) 0 }}
<a style="text-decoration: none" href="{{ $lastInSection.RelPermalink }}">{{ $lastInSection.Title }}</a>
{{ end }}
</td>
<td style="text-align:right">
{{ with .NextInSection }}
<a style="text-decoration: none" href="{{ .RelPermalink }}">{{ .Title }}</a>
{{ else }}
{{ $firstInSection := index (first 1 .CurrentSection.Pages.ByPublishDate) 0 }}
<a style="text-decoration: none" href="{{ $firstInSection.RelPermalink }}">{{ $firstInSection.Title }}</a>
{{ end }}
</td>
</tr>
</table>
<hr>

0 comments on commit 5bd4c01

Please sign in to comment.