Skip to content

Commit

Permalink
👍
Browse files Browse the repository at this point in the history
  • Loading branch information
iskrisis committed Jun 10, 2021
1 parent 09f1744 commit 4df0f48
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,25 @@ Plugin doesn't require any additional setup.
You can change name of `blocks` directory using option `floriankarsten.merkur-blocks-loader.dirname`.
You can turn off caching using `floriankarsten.merkur-blocks-loader.cache`

```php
// Default settings
[
'floriankarsten.merkur-blocks-loader' => [
'cache'=> true,
'dirname' => 'blocks'
],
]
```


## Caching
There is very basic caching strategy thats turned on when option `debug` = false. I probably have to come up with something better (ideas welcome) but it works OK now. Cache can be turned off using `floriankarsten.merkur-blocks-loader.cache`
There is very basic caching strategy thats turned on when option `debug` = false. I probably have to come up with something better (ideas welcome) but it works OK now. Cache can be turned off using `floriankarsten.merkur-blocks-loader.cache` === `false`

## Loading chain
Files loaded from plugins < Files loaded from Blocks loader < Files loaded from default paths
Files loaded from `plugins` < Files loaded from `Blocks Loader` < Files loaded from `default` paths

When you load multiple blueprint/template with same name it gets overwritten and the last one gets used. Kirby default paths go last so they will take precedence over everything. This plugin loads files from `system.loadPlugins:after` hook so it will take precedence over files loaded from plugins. For example if you have both `site/blueprints/blocks/example.yml` and `site/blocks/example/example.yml` then default `site/blueprints/blocks/example.yml` will be used.

# Ieas
# Ideas
- How to make caching better?
- Loading from multiple locations?

0 comments on commit 4df0f48

Please sign in to comment.