-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
31 lines (27 loc) · 872 Bytes
/
index.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
<?php
@include_once __DIR__ . '/vendor/autoload.php';
Kirby::plugin('floriankarsten/merkur-blocks-loader', [
'options' => [
'cache' => true
],
'hooks' => [
'system.loadPlugins:after' => function () {
if (option('debug') || option('floriankarsten.merkur-blocks-loader.cache', true)) {
$blocks = \Merkur\Blocksloader::loadBlocks();
} else {
$blocksCache = kirby()->cache('floriankarsten.merkur-blocks-loader');
$blocks = $blocksCache->get('blocks');
if ($blocks === null) {
$blocks = \Merkur\Blocksloader::loadBlocks();
$blocksCache->set('blocks', $blocks, 600);
}
}
if (!empty($blocks['blueprints']) || !empty($blocks['snippets'])) {
kirby()->extend([
'blueprints' => $blocks['blueprints'],
'snippets' => $blocks['snippets'],
], kirby()->plugin('floriankarsten.merkur-blocks-loader'));
}
}
]
]);