aboutsummaryrefslogtreecommitdiffhomepage
path: root/navigation
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2024-05-29 13:23:36 +0200
committerBjørn Erik Pedersen <[email protected]>2024-05-30 11:29:21 +0200
commit245928a1ff49c6a1c25524f08bf538b0ab88f1a8 (patch)
tree1fa4d9ffe812f4f78eebc43f114b3dcc2b0442a0 /navigation
parent519f41dbd72d4b13208225ab5b28c6d98ecb07ba (diff)
downloadhugo-245928a1ff49c6a1c25524f08bf538b0ab88f1a8.tar.gz
hugo-245928a1ff49c6a1c25524f08bf538b0ab88f1a8.zip
content adapter: Add support for menus in AddPage
Fixes #12507
Diffstat (limited to 'navigation')
-rw-r--r--navigation/pagemenus.go15
1 files changed, 3 insertions, 12 deletions
diff --git a/navigation/pagemenus.go b/navigation/pagemenus.go
index 3ff49cf81..0919d93bb 100644
--- a/navigation/pagemenus.go
+++ b/navigation/pagemenus.go
@@ -41,20 +41,11 @@ type MenuQueryProvider interface {
IsMenuCurrent(menuID string, inme *MenuEntry) bool
}
-func PageMenusFromPage(p Page) (PageMenus, error) {
- params := p.Params()
-
- ms, ok := params["menus"]
- if !ok {
- ms, ok = params["menu"]
- }
-
- pm := PageMenus{}
-
- if !ok {
+func PageMenusFromPage(ms any, p Page) (PageMenus, error) {
+ if ms == nil {
return nil, nil
}
-
+ pm := PageMenus{}
me := MenuEntry{}
SetPageValues(&me, p)