Hi @hptarora
You can define a page property(let's say homePage) where you can author the home page link. Let's say your home page is /content/something/en_us/index
Now your page node contains homePage=/content/something/en_us/index value in crx.
Now in you sling model you can read the homePage property value and can compare with currentPage object which is OOTB and available with @ScriptVariable annotation.
Put a condition if homePage = currentPage.getPath() then you are on Home page else you are on other pages.
@ScriptVariable
private Page currentPage;
@ValueMapValue
private String homePage;
if (StringUtils.isNoneEmpty(currentPage.getPath(), homePage) && StringUtils.equalsIgnoreCase(currentPage.getPath(), homePage)) {
// Home page
}
Thanks!