public static boolean isPaginationEnabled(Site site, Page page){
return isPaginationEnabled(site.getConfig().toMap(), page);
}
public static boolean isPaginationEnabled(Map<String, Object> config, Page page) {
SourceEntry entry = page.getSource().getSourceEntry();
String name = entry.getName();
String path = entry.getPath();
// (isIndexPaginationEnabled || isNormalPagePaginationEnabled) && containsPaginatorInContent
return (config.containsKey("paginate") && "".equals(path) && "index.html".equals(name)
|| page.get("paginate") != null)
&& page.getContent().contains("paginator.");
}