The link_to helper is sitemap aware, and according to the documentation, it can determine if the URL you provide is in the sitemap:
Middleman enhances the link_to helper to be aware of the sitemap. If
you refer to pages in your source folder (with their file extension
minus all the template extensions) then link_to will generate the
correct link……If the link_to helper fails to determine which page
the URL provided belongs to, it will use the URL without modifying it.
I’d like to create a link_to which points to index.html, but if there isn’t an index.html, there is no link generated at all (rather than the default behavior where a broken link is generated). Any ideas?