forked from tailwindlabs/tailwindcss.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.php
45 lines (41 loc) · 1.65 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
<?php
use Illuminate\Support\Collection;
return [
'baseUrl' => '',
'production' => false,
'collections' => [],
'docSearchVersion' => 'v1',
'config' => json_decode(file_get_contents(__DIR__ . '/tailwind.json'), true),
'version' => json_decode(file_get_contents(__DIR__ . '/node_modules/tailwindcss/package.json'), true)['version'],
'colors' => ['red', 'orange', 'yellow', 'green', 'teal', 'blue', 'indigo', 'purple', 'pink'],
'activeCategory' => function ($page) {
if (starts_with($page->getPath(), '/docs')) {
return 'Documentation';
} elseif (starts_with($page->getPath(), '/components')) {
return 'Components';
} elseif (starts_with($page->getPath(), '/resources')) {
return 'Resources';
} elseif (starts_with($page->getPath(), '/community')) {
return 'Community';
}
},
'active' => function ($page, $link) {
$path = $link instanceof Collection ? $link['url'] : $link;
$pages = collect(array_wrap($page));
return $pages->contains(function ($page) use ($path) {
return starts_with($page->getPath(), $path);
});
},
'getLink' => function ($page, $link) {
return $link instanceof Collection ? $link['url'] : $link;
},
'isExternal' => function ($page, $link) {
return $link instanceof Collection ? $link['external'] : false;
},
'anyChildrenActive' => function ($page, $children) {
return $children->contains(function ($link) use ($page) {
return $page->getPath() == '/docs/'. $link;
});
},
'navigation' => require_once('navigation.php'),
];