mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-31 22:41:53 +02:00
navigation: Unexport menu entry methods
- MenuEntry.IsEqual - MenuEntry.IsSameResource Closes #11670
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
805cc1773b
commit
80d2fdbaa0
@@ -138,7 +138,7 @@ func (pm *pageMenus) HasMenuCurrent(menuID string, me *MenuEntry) bool {
|
||||
|
||||
if m, ok := menus[menuID]; ok {
|
||||
for _, child := range me.Children {
|
||||
if child.IsEqual(m) {
|
||||
if child.isEqual(m) {
|
||||
return true
|
||||
}
|
||||
if pm.HasMenuCurrent(menuID, child) {
|
||||
@@ -168,7 +168,7 @@ func (pm *pageMenus) IsMenuCurrent(menuID string, inme *MenuEntry) bool {
|
||||
menus := pm.pagem.Menus()
|
||||
|
||||
if me, ok := menus[menuID]; ok {
|
||||
if me.IsEqual(inme) {
|
||||
if me.isEqual(inme) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
@@ -185,7 +185,7 @@ func (pm *pageMenus) IsMenuCurrent(menuID string, inme *MenuEntry) bool {
|
||||
// Search for it to make sure that it is in the menu with the given menuId.
|
||||
if menu, ok := pm.sitem.Menus()[menuID]; ok {
|
||||
for _, menuEntry := range menu {
|
||||
if menuEntry.IsSameResource(inme) {
|
||||
if menuEntry.isSameResource(inme) {
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ func (pm *pageMenus) IsMenuCurrent(menuID string, inme *MenuEntry) bool {
|
||||
func (pm *pageMenus) isSameAsDescendantMenu(inme *MenuEntry, parent *MenuEntry) bool {
|
||||
if parent.HasChildren() {
|
||||
for _, child := range parent.Children {
|
||||
if child.IsSameResource(inme) {
|
||||
if child.isSameResource(inme) {
|
||||
return true
|
||||
}
|
||||
descendantFound := pm.isSameAsDescendantMenu(inme, child)
|
||||
|
Reference in New Issue
Block a user