Files
kestrelsnest-blog/layouts/partials/series.html
Eric Wagoner 744235b47f Add LocallyGrown series part 6 and implement series navigation
- Add final part of LocallyGrown.net series: "From Survival to Sustainability"
- Implement Hugo series taxonomy for better content organization
- Add series navigation partial showing all 6 parts with prev/next links
- Update all LocallyGrown posts with series metadata and ordering
- Display series indicators on index page for connected content
- Style series navigation with responsive design and dark mode support
- Fix series links across all posts to use correct slugs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-29 01:12:22 -04:00

66 lines
2.1 KiB
HTML

{{ with .Params.series }}
{{ $currentPage := $ }}
{{ $series := index . 0 }}
{{ $currentOrder := $.Params.series_order }}
{{/* Get all posts in this series */}}
{{ $seriesPosts := where $.Site.RegularPages "Params.series" "intersect" (slice $series) }}
{{ $seriesPosts = sort $seriesPosts "Params.series_order" }}
{{ $totalParts := len $seriesPosts }}
{{ if gt $totalParts 1 }}
<div class="series-box">
<div class="series-header">
<strong>{{ $series }}</strong>
<span class="series-part">Part {{ $currentOrder }} of {{ $totalParts }}</span>
</div>
<nav class="series-nav">
<ol class="series-list">
{{ range $seriesPosts }}
<li class="{{ if eq .RelPermalink $currentPage.RelPermalink }}current{{ end }}">
{{ if eq .RelPermalink $currentPage.RelPermalink }}
<strong>{{ .Title }}</strong>
{{ else }}
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
{{ end }}
</li>
{{ end }}
</ol>
</nav>
<div class="series-navigation">
{{/* Previous post */}}
{{ $prevPost := "" }}
{{ $nextPost := "" }}
{{ $foundCurrent := false }}
{{ range $seriesPosts }}
{{ if $foundCurrent }}
{{ if not $nextPost }}
{{ $nextPost = . }}
{{ end }}
{{ else if eq .RelPermalink $currentPage.RelPermalink }}
{{ $foundCurrent = true }}
{{ else }}
{{ $prevPost = . }}
{{ end }}
{{ end }}
<div class="series-nav-links">
{{ with $prevPost }}
<a href="{{ .RelPermalink }}" class="series-prev">← Previous: {{ .Title }}</a>
{{ else }}
<span class="series-prev disabled">← Previous</span>
{{ end }}
{{ with $nextPost }}
<a href="{{ .RelPermalink }}" class="series-next">Next: {{ .Title }} →</a>
{{ else }}
<span class="series-next disabled">Next →</span>
{{ end }}
</div>
</div>
</div>
{{ end }}
{{ end }}