fix number of ancestors (getAncestors by default doesn't return the current page)

This commit is contained in:
Florian Thoma 2020-09-19 16:22:17 +10:00
parent ced2213be4
commit f026001f8b

View File

@ -116,7 +116,7 @@ class GoogleSitemapSiteTreeExtension extends GoogleSitemapExtension
if (!$priority) {
$parentStack = $this->owner->getAncestors();
$numParents = $parentStack->count() - 1;
$numParents = $parentStack->count();
$num = max(0.1, 1.0 - ($numParents / 10));
$result = str_replace(",", ".", $num);