Skip to content

Commit

Permalink
Use $currentPage to check if sidebar item is active
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed May 7, 2022
1 parent 758190a commit 491b480
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions resources/views/layouts/docs.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
<nav id="sidebar-navigation">
<ul id="sidebar-navigation-menu" role="list">
@foreach (Hyde\Framework\Services\DocumentationSidebarService::get() as $item)
<li @class([ 'sidebar-navigation-item' , 'active'=> $item->destination === $docs->slug])>
@if($item->destination === $docs->slug)
<li @class([ 'sidebar-navigation-item' , 'active'=> $item->destination === basename($currentPage)])>
@if($item->destination === basename($currentPage))
<a href="{{ $item->destination }}.html" aria-current="true">{{
$item->label }}</a>

Expand Down

0 comments on commit 491b480

Please sign in to comment.