(sidebar_items)
return filtered_sidebar_items
Exclude sidebar items where `item["show_in_navigation"] == False`
Exclude sidebar items where `item["show_in_navigation"] == False`
Exclude sidebar items where item [ show_in_navigation ] == False
def _filter_sidebar_items(sidebar_items):
        """
        Exclude sidebar items where `item["show_in_navigation"] == False`
        """
        filtered_sidebar_items = []
        for section, items in sidebar_items:
            filtered_items = []
            for item in items:
                if not item.get("show_in_navigation", True):
                    continue
                filtered_items.append(item)
            if filtered_items:
                filtered_sidebar_items.append((section, filtered_items))
        return filtered_sidebar_items
def _filter_sidebar_items ( sidebar_items ) : filtered_sidebar_items = [ ] for section , items in sidebar_items : filtered_items = [ ] for item in items : if not item . get ( "show_in_navigation" , True ) : continue filtered_items . append ( item ) if filtered_items : filtered_sidebar_items . append ( ( section , filtered_items ) ) return filtered_sidebar_items