Skip to content

Commit a58d850

Browse files
committed
Create table-of-contents.blade.php
1 parent f93a7ba commit a58d850

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
@props(['items'])
2+
3+
<ul class="py-3 space-y-1.5">
4+
@foreach($items as $item)
5+
<li>
6+
<a href="#{{ $item['slug'] }}"
7+
class="block pl-8 -ml-8 opacity-80 hover:opacity-100 hover:bg-gray-200/20 transition-all duration-300 relative">
8+
<span class="text-[75%] opacity-50 mr-1 hover:opacity-100 transition-opacity duration-300">#</span>
9+
{{ $item['title'] }}
10+
</a>
11+
12+
@if(!empty($item['children']))
13+
<ul class="pl-2">
14+
<x-hyde::docs.table-of-contents :items="$item['children']" />
15+
</ul>
16+
@endif
17+
</li>
18+
@endforeach
19+
</ul>

0 commit comments

Comments
 (0)