}
});
}
public static boolean isSourceStale(Site site){
BuildInfo buildInfo = site.getLastBuildInfo();
if(buildInfo == null){
log.info("No last generate info, regenerate site.");
return true;
}
boolean showDrafts = site.showDrafts();
if(showDrafts != buildInfo.showDrafts()){
log.info(String.format("Show drafts changed, last: %s, current: %s. regenerate site.", buildInfo.showDrafts(), showDrafts));
return true;
}
long lastBuildTime = buildInfo.getBuildTime();
if(lastBuildTime <= 0L){
log.info("No last generate time, regenerate site.");
return true;
}