DOC-1116: Enable nav accordion only when necessary

The {expand, collapse} all link in the navigation sidebar should only
appear if there actually are sections to expand or collapse.