Skip to content

version 3.1

Compare
Choose a tag to compare
@jirkapinkas jirkapinkas released this 25 Dec 10:14
· 139 commits to master since this release

Added method addPages(Collection, Function), which simplifies population of sitemap using functional style of programming:

File file = new File("/var/www/sitemap.xml");
List<String> pages = Arrays.asList("firstPage", "secondPage", "otherPage");
// create web sitemap for web http://www.javavids.com
new SitemapGenerator("http://www.javavids.com")
    .addPage(WebPage.builder().nameRoot().priorityMax().changeFreqNever().lastModNow().build())
    .addPages(urls, page -> WebPage.builder().name("dir/" + page).priorityMax().changeFreqNever().lastModNow().build())
    .constructAndSaveSitemap(file);

Also on WebPageBuilder added nameRoot() method, which is short hand for name("")