Skip to content

Commit

Permalink
Merge branch 'hotfix/1.2.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
werner-freytag committed Mar 15, 2022
2 parents ed829ec + a7fafde commit 4ae8556
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
"description": "Simple sitemap addon for Statamic v3",
"type": "statamic-addon",
"license": "MIT",
"keywords": [
"statamic",
"sitemap"
],
"require": {
"php": "^5.4 || ^7.0 || ^8.0",
"statamic/cms": "^3.0.0"
Expand Down
5 changes: 5 additions & 0 deletions src/Models/Sitemap.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Statamic\Facades\Collection;
use Statamic\Facades\Site;
use Statamic\Facades\Taxonomy;
use Statamic\Fields\Value;

class Sitemap
{
Expand Down Expand Up @@ -49,6 +50,10 @@ public static function entries(): array
$properties = ($callback($entry) ?? []) + $properties;
}

$properties = array_map(static function ($value) {
return $value instanceof Value ? $value->value() : $value;
}, $properties);

return new SitemapEntry($properties['loc'], $properties['lastmod'], $properties['changefreq'], $properties['priority']);
})
->values()
Expand Down

0 comments on commit 4ae8556

Please sign in to comment.