-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.php
More file actions
48 lines (41 loc) · 1.44 KB
/
Copy pathbootstrap.php
File metadata and controls
48 lines (41 loc) · 1.44 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
48
<?php
PHP_EOL;
use App\IgnoredHandler;
use TightenCo\Jigsaw\Jigsaw;
use TightenCo\Jigsaw\SiteBuilder;
use TightenCo\Jigsaw\File\Filesystem;
use TightenCo\Jigsaw\Handlers\BladeHandler;
use TightenCo\Jigsaw\Handlers\DefaultHandler;
use TightenCo\Jigsaw\Handlers\MarkdownHandler;
use TightenCo\Jigsaw\Handlers\PaginatedPageHandler;
use TightenCo\Jigsaw\Handlers\CollectionItemHandler;
/** @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
* });
*/
$container->bind(IgnoredHandler::class, function ($c) {
return new IgnoredHandler($c['config']);
});
$container->bind(SiteBuilder::class, function ($c) use ($cachePath) {
return new SiteBuilder(new Filesystem, $cachePath, $c['outputPathResolver'], $c['consoleOutput'], [
$c[CollectionItemHandler::class],
$c[IgnoredHandler::class],
$c[PaginatedPageHandler::class],
$c[MarkdownHandler::class],
$c[BladeHandler::class],
$c[DefaultHandler::class],
]);
});
$events->afterBuild(function ($jigsaw) {
$files = $jigsaw->getFilesystem();
$content = rtrim($jigsaw->getSourcePath(), '/');
$assets = ltrim($jigsaw->getConfig('build.assets'), '/');
});