This page permanently redirects to gemini://gmi.bacardi55.io/blog/2024/02/18/add-prev-next-articles-with-hugo/.

Add previous / next articles with hugo

Posted on 2024-02-18

Another short post about my [hugo] [configuration] update, as I have added navigation for previous / next posts.

To do so, I added a configuration in `config.toml':

[params]
  […]
  enableNextPrevPages = true

Then, in the `single.html' template file, I added:

{{ if .Site.Params.enableNextPrevPages }}
    {{ partial "article-prevnext.html" . }}
{{ end }}

And then created the =article-prevnext.html" partial:

The .NextInSection' and .PrevInSection' allow to link to only other [blog posts] and not [bookmarks] or [gemlog entries].

And added to the CSS file this simple line:

.article-nextprev{
    display:flex;
    flex-flow: row wrap-reverse;
    justify-content: space-between;
}

=> hugo | configuration | blog posts | bookmarks | gemlog entries

=> /gemlog/

=> Send me a gemini mention | send me an email!

Proxy Information
Original URL
gemini://gmi.bacardi55.io/blog/2024/02/18/add-prev-next-articles-with-hugo
Status Code
Success (20)
Meta
text/gemini; lang=en
Capsule Response Time
407.203268 milliseconds
Gemini-to-HTML Time
1.416762 milliseconds

This content has been proxied by September (3851b).