-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
bootstrap.php
61 lines (46 loc) · 1.72 KB
/
bootstrap.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
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
// @var $container \Illuminate\Container\Container
// @var $events \TightenCo\Jigsaw\Events\EventBus
/*
* You can run custom code at different stages of the build process by
* listening to the 'beforeBuild', 'afterCollections', and 'afterBuild' events.
*
* For example:
*
* $events->beforeBuild(function (Jigsaw $jigsaw) {
* // Your code here
* });
*/
$events->afterBuild(App\Listeners\GenerateSitemap::class);
$events->afterBuild(App\Listeners\GenerateIndex::class);
$events->afterBuild(App\Listeners\GenerateHtaccess::class);
$events->afterBuild(App\Listeners\SetinMathjax::class);
$events->afterBuild(App\Listeners\HighlightCodeSyntax::class);
// use TightenCo\Jigsaw\Jigsaw;
/** @var $container \Illuminate\Container\Container */
/** @var $events \TightenCo\Jigsaw\Events\EventBus */
/**
* You can run custom code at different stages of the build process by
* listening to the 'beforeBuild', 'afterCollections', and 'afterBuild' events.
*
* For example:
*
* $events->beforeBuild(function (Jigsaw $jigsaw) {
* // Your code here
* });
*/
// $events->afterCollections(function (Jigsaw $jigsaw) {
// $posts = $jigsaw->getCollection('posts');
// foreach($posts as $post) {
// $dom = new DOMDocument();
// $dom->loadHTML($post->getContent());
// foreach ($dom->getElementsByTagName('img') as $img) {
// $src = $img->getAttribute('src');
// $tiny_src = str_replace('/assets/images/', '/images/tiny/', $src);
// $medium_src = str_replace('/assets/images/', '/images/medium/', $src);
// $img->setAttribute('src', $tiny_src);
// $img->setAttribute('srcset', $medium_src);
// }
// dd($dom); // Outputs the html I want
// }
// });