@Override
public void render(Map<String, Object> rootMap) {
//comment this, call convert() separately.
//convert();
Renderer renderer = getRenderer();
boolean isContentRenderRequired = renderer.isRenderRequired(getContent());
boolean isValidLayout = renderer.isValidLayout(getLayout());
if(!isValidLayout && !isContentRenderRequired){
log.debug("Layout is nil and content is plain text, skip render file: "
+ getSource().getSourceEntry().getFile());
//output = content;
//do nothing
return;
}
rootMap = new HashMap<String,Object>(rootMap);
mergeRootMap(rootMap);
//if content is plain text
if(!isContentRenderRequired){
rootMap.put("content", getContent());
}
String name = isContentRenderRequired ? renderer.prepareWorkingTemplate(getLayout(), isValidLayout,
getContent(), isContentRenderRequired,
getSource().getSourceEntry())
: renderer.getLayoutWorkingTemplate(getLayout());
String output = renderer.render(name, rootMap);
// String output = getRenderer().render(getLayout(), getContent(), getSource().getSourceEntry(), rootMap);
setContent(output);
}