Skip to content

Commit

Permalink
Bring back is_current. Closes #1300
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonvarga committed Mar 26, 2020
1 parent 1c10ec1 commit 8e14462
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Tags/Nav.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ public function breadcrumbs()
$this->content = trim($this->content);
}

$output = $this->parseLoop($crumbs->values()->toAugmentedArray());
$crumbs = $crumbs->values()->map(function ($crumb) {
$crumb->setSupplement('is_current', URL::getCurrent() === $crumb->url());
return $crumb;
});

$output = $this->parseLoop($crumbs->toAugmentedArray());

if ($backspaces = $this->params->int('backspace', 0)) {
$output = substr($output, 0, -$backspaces);
Expand Down

0 comments on commit 8e14462

Please sign in to comment.