No. There is no direct way to do it. The following excerpt from the Sightly docs tells you why
Separation of Concerns: The expressiveness of the Sightly template language is purposely limited, in order to make sure that a real programming language is used to express the corresponding presentation logic. This optional logic is invoked from Sightly expressions with the Use-API pattern, making it easy to understand what is called for a given view, and to potentially have different logic for different views of the same resource.
I would suggest either using a Java / JavaScript Use API to achieve the same.
However if it is inevitable that you need to do this in Sightly itself, then you can use the following dirty hack, though I wouldn't recommend it.
<sly data-sly-test.pagePath = "${currentPage.path}.html"></sly>
<sly data-sly-test = "${pageHref == pagePath}">
<!--/** Your HTML here */-->
</sly>
A similar kind of question has been answered here.