Skip to content

Commit

Permalink
Sort report pages by canonical URL.
Browse files Browse the repository at this point in the history
  • Loading branch information
jesseleite committed Jan 4, 2024
1 parent f8f56a1 commit 6b1393e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Reporting/Report.php
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,10 @@ public function withPages($preferCache = false)

$this->pages = collect($files)
->map(fn ($file) => YAML::parse(File::get($file)))
->map(fn ($yaml) => (new Page($yaml['id'], $yaml['data'], $this))->setResults($yaml['results']));
->map(fn ($yaml) => (new Page($yaml['id'], $yaml['data'], $this))->setResults($yaml['results']))
->sortBy
->url()
->values();

if ($this->isGenerated()) {
Cache::put($this->cacheKey(static::PAGES_CACHE_KEY_SUFFIX), $this->pages);
Expand Down

0 comments on commit 6b1393e

Please sign in to comment.