-
Notifications
You must be signed in to change notification settings - Fork 5
/
config.php
48 lines (43 loc) · 1.53 KB
/
config.php
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
<?php
use Illuminate\Support\Str;
return [
'production' => false,
'baseUrl' => '',
'title' => 'Debugbar For Ruby on Rails',
'description' => 'Rails debugging dev tools for faster development. Inspect your request details (queries, logs, cache, jobs and more).',
'githubRepo' => 'https://github.com/julienbourdeau/debugbar',
'navigation' => require_once('navigation.php'),
'collections' => [
'docs' => [
'path' => 'docs/{slug}',
'extends' => '_layouts.docs',
'section' => 'content',
'map' => function ($post) {
return App\DocPage::fromItem($post);
},
],
],
'getSeoTitle' => function ($page) {
if ($page->seo_title) {
return $page->seo_title;
}
return $page->title.' | Ruby On Rails Debugbar';
},
'activePage' => function ($page, $section, $mode = 'contains'): bool {
// $path = ltrim($page->getPath(), '/');
$path = $page->getPath();
$cb = match ($mode) {
'exact' => fn ($s) => $path === $s,
'contains' => fn ($s) => Str::contains($path, $s),
'starts_with' => fn ($s) => str_starts_with($path, $s),
};
return collect($section)->contains($cb);
},
'getDocsToc' => function ($page) {
global $docsToc;
return clone $docsToc;
},
'screenshot' => function ($page, $img, $alt = 'debugbar screenshot') {
return "<img src='/assets/screenshots/$img.png' alt='$alt' class='' />";
},
];