-
-
Notifications
You must be signed in to change notification settings - Fork 108
Expand file tree
/
Copy pathindex.blade.php
More file actions
161 lines (142 loc) · 5.56 KB
/
index.blade.php
File metadata and controls
161 lines (142 loc) · 5.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
@push('head')
<meta name="docsearch:platform" content="{{ $platform }}" />
<meta name="docsearch:version" content="{{ $version }}" />
@endpush
<x-docs-layout>
<x-slot name="sidebarLeft">
{!! $navigation !!}
</x-slot>
<x-slot name="sidebarRight">
{{-- Version switcher --}}
@if($platform === 'desktop')
<livewire:version-switcher :versions="[
1 => '1.x',
2 => '2.x'
]" />
@elseif($platform === 'mobile')
<livewire:version-switcher :versions="[
1 => '1.x',
2 => '2.x',
3 => '3.x'
]" />
@endif
<x-docs.toc-and-sponsors :tableOfContents="$tableOfContents">
{{-- Ad rotation --}}
<x-blog.ad-rotation
:ads="$platform === 'desktop' ? ['mobile', 'ultra', 'vibes', 'masterclass'] : ['devkit', 'ultra', 'vibes', 'masterclass']"
/>
</x-docs.toc-and-sponsors>
</x-slot>
<x-docs.old-version-notice
:platform="$platform"
:version="$version"
:page="request()->route('page')"
/>
<h1 class="text-4xl font-semibold">
{{ $title }}
</h1>
<x-docs.separator class="mt-4" />
{{-- Table of contents --}}
<div class="xl:hidden pt-9 space-y-4">
{{-- Version switcher --}}
@if($platform === 'desktop')
<livewire:version-switcher :versions="[
1 => '1.x',
2 => '2.x'
]" />
@elseif($platform === 'mobile')
<livewire:version-switcher :versions="[
1 => '1.x',
2 => '2.x',
3 => '3.x'
]" />
@endif
{{-- Copy as Markdown Button --}}
<x-docs.copy-markdown-button />
</div>
@if (count($tableOfContents) > 0)
<div class="sticky top-20 z-10 mt-8 mb-4 flex justify-end">
<div class="rounded-full bg-white shadow-sm dark:bg-zinc-800">
<flux:dropdown position="bottom" align="end">
<flux:button variant="filled" size="sm" class="!rounded-full">
<x-icons.stacked-lines class="size-4" />
On this page
</flux:button>
<flux:popover class="w-64">
<nav class="flex max-h-80 flex-col gap-0.5 overflow-y-auto">
@foreach ($tableOfContents as $item)
<a
href="#{{ $item['anchor'] }}"
x-on:click.prevent="document.getElementById('{{ $item['anchor'] }}')?.scrollIntoView({ behavior: 'smooth', block: 'start' })"
@class([
'rounded-md px-2 py-1.5 text-xs transition hover:bg-zinc-100 dark:text-white/80 dark:hover:bg-zinc-700',
'pl-2' => $item['level'] == 2,
'pl-5' => $item['level'] == 3,
])
>
{{ $item['title'] }}
</a>
@endforeach
</nav>
</flux:popover>
</flux:dropdown>
</div>
</div>
@endif
<div
class="prose dark:prose-invert prose-headings:scroll-mt-20 prose-headings:text-gray-800 sm:prose-headings:scroll-mt-32 dark:prose-headings:text-gray-50 max-w-none"
>
{!! $content !!}
</div>
<x-docs.separator class="mt-8" />
@php
$linkAlign = $previousPage === null ? 'right' : 'between';
@endphp
<x-docs.flex-list-of-links
align="{{$linkAlign}}"
class="mt-5"
>
@if ($previousPage !== null)
<x-docs.link-button href="{{ $previousPage['path'] }}">
<div class="self-center justify-self-start">
<div
class="flex items-center justify-start gap-1.5 opacity-60"
>
<x-icons.right-arrow
class="size-3 shrink-0 -scale-x-100"
/>
<div class="text-sm">Previous</div>
</div>
<div class="pt-1">{{ $previousPage['title'] }}</div>
</div>
</x-docs.link-button>
@endif
@if ($nextPage !== null)
<x-docs.link-button href="{{ $nextPage['path'] }}">
<div class="self-center justify-self-end">
<div
class="flex items-center justify-end gap-1.5 opacity-60"
>
<div class="text-sm">Next</div>
<x-icons.right-arrow class="size-3 shrink-0" />
</div>
<div class="pt-1">{{ $nextPage['title'] }}</div>
</div>
</x-docs.link-button>
@endif
</x-docs.flex-list-of-links>
<div class="pt-5 text-center sm:text-left">
<x-docs.link-subtle
href="{{ $editUrl }}"
target="_blank"
rel="noopener"
>
Edit this page on GitHub
</x-docs.link-subtle>
</div>
{{-- Mobile ad rotation --}}
<x-blog.ad-rotation
class="mx-auto mt-5 max-w-52 xl:hidden"
:ads="$platform === 'desktop' ? ['mobile', 'ultra', 'vibes', 'masterclass'] : ['devkit', 'ultra', 'vibes', 'masterclass']"
/>
</x-docs-layout>