previous and next post functionality has been added

This commit is contained in:
Peter 2025-03-18 13:35:25 -04:00
parent 5333b63af9
commit b264c68630
3 changed files with 14 additions and 2 deletions

View file

@ -30,6 +30,15 @@
<dd>{{ i18n "reading_time_desc" .ReadingTime }}</dd>
{{ end }}
</dl>
{{ $pages := .CurrentSection.Pages.ByWeight }}
{{ with $pages.Prev . }}
<a href="{{ .RelPermalink }}">« Entrada anterior</a>
{{ end }}
/
{{ with $pages.Next . }}
<a href="{{ .RelPermalink }}">Entrada siguiente »</a>
{{ end }}
</section>
{{ end }}
<div>
@ -57,6 +66,7 @@
{{ end }}
</ul>
{{ end }}
</br>
</div>
</div>
</br>

View file

@ -34,7 +34,9 @@
</div>
</div>
</a>
{{ range .Pages.ByWeight }}
<h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
{{ end }}
{{end}}
{{ template "partials/pagination.html" . }}

View file

@ -1,5 +1,5 @@
{{ with site.RegularPages.Related . | first 5 }}
<p>Related content:</p>
<p>Leer también:</p>
<ul>
{{ range . }}
<li><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>