Hey Hugo-Users,
I have a small problem with the order of pages: Despite using the weights it orders in the wrong way…
My github repo is here: GitHub - wehrend/wehrend.github.io and my page is here: https://wehrend.github.io/
The page 11_clocks_registers is shown instead of the page 06_Memory (as you can see I order by numbers)… Below the different front matters of the different pages:
title: 05_ALU
date: 2022-03-11
category: “digital_logic_1”
link:
description:
type: text
bookHidden: true
menu:
docs:
parent: “digital_logic_1”
weight: 50
–
title: 06_Memory
date: 2022-03-20
category: “digital_logic_1”
link:
description:
type: text
bookHidden: true
menu:
docs:
parent: “digital_logic_1”
weight: 60
title: 11_Clocks_flipflops_and_registers
date: 2022-03-12
category: “digital_logic_2”
link:
description:
type: text
bookHidden: true
menu:
docs:
parent: “digital_logic_2”
weight: 120
___
If you have any idea I would be happy to know, I tried a bit with different values for the front matter…
irkode
December 7, 2025, 2:26pm
2
mmh, it will be good:
to tell us about the source /content path of
the pages in mention
the page where you have something displayed in wrong order
and to further ease up the path of the layout template responsible for generating that
Your link shows up like that:
and three code fences will improve readability of your posted code
additional hint: when I clone I get:
warning: the following paths have collided (e.g. case-sensitive paths
on a case-insensitive filesystem) and only one from the same
colliding group is in the working tree:
‘content/de/posts/synth/lfo_sem_patch2-3.JPG’
‘content/de/posts/synth/lfo_sem_patch2-3.jpg’
content/en/pages/digital_logic/05_ALU.md
content/en/pages/digital_logic/06_Memory.md
content/en/pages/digital_logic_2/11_Clocks_flipflops_and_registers.md
On the page
https://wehrend.github.io/en/pages/digital_logic/05_ALU/
the Prev/Next navigation shows:
irkode
December 7, 2025, 5:00pm
4
I think you have set a weight for the menu entries not for the pages
---
title: 11_Clocks_flipflops_and_registers (de)
bookHidden: true
menu:
docs:
parent: "digital_logic_2"
weight: 10 <-- not the page weigth
---
Nevertheless:
the logic for prev next is in themes\hugo-book\layouts\_partials\docs\prev-next.html (line 7)
{{ $pages := partialCached "docs/prev-next-cache" .Pages }}
{{/* HIER ändern: */}}
{{ $prev := $pages.Prev $ }}
{{ $next := $pages.Next $ }}
The result is cached without Context (and stored in a .Scratch) - so I guess the first invocations wins.
There’s no sort, ByWeight, … so whatever order there is it depends on the partial creating the cache.
If I change line 7 to {{ $pages := (partialCached "docs/prev-next-cache" .Pages).ByTitle }}
the order is as expected 04 05 06 …
maybe setting a page weight and use .ByWeight…
I believe that would be best addressed to the theme author - I won’t dig in further
This worked, but I needed to take it reversed for the right order…
If I change line 7 to {{ $pages := (partialCached "docs/prev-next-cache" .Pages).ByTitle }}
the order is as expected 04 05 06 …
So the result is below…
{{ $pages := (partialCached “docs/prev-next-cache” .Pages).ByTitle.Reverse }}