Changed generate function to not fail on empty site.