forked from rickwest/devsnippets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.php
30 lines (26 loc) · 961 Bytes
/
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
<?php
return [
'baseUrl' => '',
'production' => false,
'siteName' => 'Dev Snippets',
'siteDescription' => 'A collection of useful code snippets for new developers!',
// Algolia DocSearch credentials
'docsearchApiKey' => '3fab51cde0f6a11ce324c7decd2b14c7',
'docsearchIndexName' => 'devsnippets',
// navigation menu
'navigation' => require_once('navigation.php'),
// helpers
'isActive' => function ($page, $path) {
return ends_with(trimPath($page->getPath()), trimPath($path));
},
'isActiveParent' => function ($page, $menuItem) {
if (is_object($menuItem) && $menuItem->children) {
return $menuItem->children->contains(function ($child) use ($page) {
return trimPath($page->getPath()) == trimPath($child);
});
}
},
'url' => function ($page, $path) {
return starts_with($path, 'http') ? $path : '/' . trimPath($path);
},
];