fix hierarchy beased priority calculations

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

View File

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