Skip to content

Instantly share code, notes, and snippets.

Created Sep 20, 2013
What would you like to do?
String defaultPostName = "";
//Below is logic to default posts based on page selectors.
//e.g. posts.{post-name.}.html
String selectorPath = currentPage.adaptTo(Resource.class).getResourceMetadata().getResolutionPathInfo();
String selectors[] = selectorPath.split("\\.");
if (selectors.length > 2) {
defaultPostName = selectors[1];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment