Maybe the logic should go into `toc-branch.templateHelpers`?