-
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathbuild-docs.php
More file actions
47 lines (39 loc) · 1.29 KB
/
Copy pathbuild-docs.php
File metadata and controls
47 lines (39 loc) · 1.29 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
40
41
42
43
44
45
46
47
<?php
declare(strict_types=1);
require __DIR__.'/vendor/autoload.php';
use Docsmith\Docsmith;
$output = __DIR__.'/docs';
Docsmith::make()
->source(__DIR__.'/md')
->output($output)
->title('Laravel Extended Relationships')
->description('Additional, more efficient relationship methods for Laravel Eloquent models.')
->siteUrl('https://mrpunyapal.github.io/laravel-extended-relationships')
->repositoryUrl('https://github.com/mrpunyapal/laravel-extended-relationships')
->editBranch('main')
->editPrefix('md')
->navigationOrder([
'index.md',
'installation.md',
'usage.md',
'belongs-to-many-keys.md',
'has-many-keys.md',
'has-many-array-column.md',
'belongs-to-array-column.md',
])
->ogGeneratedPerPage()
->build();
// The sitemap <lastmod> is derived from file mtimes, which differ between
// local builds and CI checkouts. Strip it so the generated site is
// deterministic and CI never produces a docs commit loop.
$sitemap = $output.'/sitemap.xml';
if (is_file($sitemap)) {
$normalized = (string) preg_replace(
'/\s*<lastmod>[^<]*<\/lastmod>/',
'',
(string) file_get_contents($sitemap),
);
if ($normalized !== '') {
file_put_contents($sitemap, $normalized);
}
}