-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.php
More file actions
39 lines (29 loc) · 1.14 KB
/
config.php
File metadata and controls
39 lines (29 loc) · 1.14 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
<?php
use \Illuminate\Support\Str;
return [
'production' => false,
'baseUrl' => '',
'title' => 'content-md - The web, spoken fluently to AI agents',
'description' => 'content-md is an open specification for optimized content exchange. Serve high-fidelity textual representation to AI agents through standard HTTP content negotiation.',
'github' => 'https://github.com/OneOffTech/contentmd',
'collections' => [],
// URL helper functions
'url' => function ($page, $path, $absolute = true) {
if(Str::startsWith($path, 'http')){
return $path;
}
if($absolute){
return rtrim($page->baseUrl, '/') . '/' . trimPath($path);
}
return '/' . trimPath($path);
},
'isActive' => function ($page, $path) {
$pagePath = str_replace('\\', '/', trimPath($page->getPath()));
$path = trimPath($path);
if(Str::endsWith($path, '*')){
$path = rtrim($path, '*');
return Str::startsWith($pagePath, $path) || $pagePath === $path;
}
return Str::endsWith($pagePath, $path) || $pagePath === $path;
},
];