-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2045 from hydephp/blade-table-of-contents-system
[2.x] Blade-based table of contents generator
- Loading branch information
Showing
14 changed files
with
1,034 additions
and
365 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
packages/framework/resources/views/components/docs/table-of-contents.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
@props(['items', 'isChild' => false]) | ||
|
||
@if(! empty($items)) | ||
<ul class="{{ ! $isChild ? 'table-of-contents pb-3' : 'pl-2' }}"> | ||
@foreach($items as $item) | ||
<li class="my-0.5"> | ||
<a href="#{{ $item['slug'] }}" class="-ml-8 pl-8 opacity-80 hover:opacity-100 hover:bg-gray-200/20 transition-all duration-300"> | ||
<span class="text-[75%] opacity-50 hover:opacity-100 transition-opacity duration-300">#</span> | ||
{{ $item['title'] }} | ||
</a> | ||
|
||
@if(! empty($item['children'])) | ||
<x-hyde::docs.table-of-contents :items="$item['children']" :isChild="true" /> | ||
@endif | ||
</li> | ||
@endforeach | ||
</ul> | ||
@endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.