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> <dd>{{ i18n "reading_time_desc" .ReadingTime }}</dd>
{{ end }} {{ end }}
</dl> </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> </section>
{{ end }} {{ end }}
<div> <div>
@ -57,6 +66,7 @@
{{ end }} {{ end }}
</ul> </ul>
{{ end }} {{ end }}
</br>
</div> </div>
</div> </div>
</br> </br>

View file

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

View file

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