Commit 11bc51a
bugfix: nested sidebar_root_for
Previously, when attempting to use nested sidebar_root_for directives,
the sidebar root displayed would be inconsistent for nested "self"
directives, and ineffective for nested "children" directives.
Investigation pointed to searching the ancestors collection in reverse
order.
Hugo documentation for the Ancestors method states:
> Hugo orders the ancestors from closest to furthest.
See https://gohugo.io/methods/page/ancestors/.
The list returned by the Anscestors list is already in "reverse" order;
calling Reverse on it gives a list with the root first, meaning that we
will find the highest-level sidebar_root_for page, rather than the
lowest level.
This commit removes the Reverse directive. sidebar_root_for directives
can now be nested correctly.1 parent 6f8f85a commit 11bc51a
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
0 commit comments