Ver Fonte

Changed: start on sidebar refactor

James Doyle há 3 anos atrás
pai
commit
839dafbb3e

+ 2 - 2
resources/css/theme-default.style.css

@@ -475,7 +475,7 @@ html {
     line-height: 1
 }
 
-.tocify-wrapper .search-results a {
+.tocify-wrapper a {
     color: #fff;
     text-decoration: none
 }
@@ -1049,4 +1049,4 @@ html {
         width: 95%;
     }
 
-}
+}

Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
resources/js/theme-default.js


+ 4 - 11
resources/views/themes/default/index.blade.php

@@ -18,7 +18,8 @@
     <link rel="stylesheet"
           href="//unpkg.com/@highlightjs/cdn-assets@10.7.2/styles/obsidian.min.css">
     <script src="//unpkg.com/@highlightjs/cdn-assets@10.7.2/highlight.min.js"></script>
-    <script>hljs.highlightAll();</script>
+
+    <script src="//cdnjs.cloudflare.com/ajax/libs/jets/0.14.1/jets.min.js"></script>
 
 @if($tryItOut['enabled'] ?? true)
     <script src="//cdn.jsdelivr.net/npm/lodash@4.17.10/lodash.min.js"></script>
@@ -53,9 +54,9 @@
     <div class="search">
         <input type="text" class="search" id="input-search" placeholder="Search">
     </div>
-    <ul class="search-results"></ul>
 
     <ul id="toc">
+        @include("scribe::themes.default.sidebar")
     </ul>
 
     @if(isset($metadata['links']))
@@ -90,13 +91,5 @@
         @endif
     </div>
 </div>
-@isset($metadata['example_languages'])
-<script>
-    $(function () {
-        var exampleLanguages = @json($metadata['example_languages']);
-        setupLanguages(exampleLanguages);
-    });
-</script>
-@endisset
 </body>
-</html>
+</html>

+ 14 - 0
resources/views/themes/default/sidebar.blade.php

@@ -0,0 +1,14 @@
+@foreach($groupedEndpoints as $group)
+<ul id="tocify-header{{ $loop->index }}" class="tocify-header">
+    <li class="tocify-item" data-unique="{!! Str::slug($group['name']) !!}">
+        <a href="#{!! Str::slug($group['name']) !!}">{!! $group['name'] !!}</a>
+    </li>
+    @foreach($group['endpoints'] as $endpoint)
+    <ul class="tocify-subheader" data-tag="{{ $loop->index }}" style="display: block;">
+        <li class="tocify-item" data-unique="{!! Str::slug($group['name']) !!}-{!! $endpoint->endpointId() !!}">
+            <a href="#{!! Str::slug($group['name']) !!}-{!! $endpoint->endpointId() !!}">{{ $endpoint->metadata->title ?: ($endpoint->httpMethods[0]." ".$endpoint->uri)}}</a>
+        </li>
+    </ul>
+    @endforeach
+</ul>
+@endforeach

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff