{"id":20205702,"url":"https://github.com/floriankarsten/merkur-blocks-loader","last_synced_at":"2025-04-10T12:13:52.470Z","repository":{"id":62505734,"uuid":"375366467","full_name":"floriankarsten/merkur-blocks-loader","owner":"floriankarsten","description":"Kirby CMS plugin to autoload blocks from a folder","archived":false,"fork":false,"pushed_at":"2023-06-05T14:51:56.000Z","size":6,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-03T03:05:24.837Z","etag":null,"topics":["kirby-cms","kirby-merkur","kirby-plugin","merkur"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/floriankarsten.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-09T13:32:34.000Z","updated_at":"2023-06-06T21:38:46.000Z","dependencies_parsed_at":"2022-11-02T12:16:54.258Z","dependency_job_id":null,"html_url":"https://github.com/floriankarsten/merkur-blocks-loader","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floriankarsten%2Fmerkur-blocks-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floriankarsten%2Fmerkur-blocks-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floriankarsten%2Fmerkur-blocks-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floriankarsten%2Fmerkur-blocks-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/floriankarsten","download_url":"https://codeload.github.com/floriankarsten/merkur-blocks-loader/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248217081,"owners_count":21066633,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["kirby-cms","kirby-merkur","kirby-plugin","merkur"],"created_at":"2024-11-14T05:18:44.935Z","updated_at":"2025-04-10T12:13:52.452Z","avatar_url":"https://github.com/floriankarsten.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Merkur Blocks Loader\n\nKirby CMS plugin for automatically loading blocks from folder (default `site/blocks`). Useful for organisation. This is part of Merkur but it can be used alone.\n\nKirby by default for \"example\" block uses files `site/blueprints/blocks/example.yml` and `site/snippets/blocks/eample.php` this plugin adds possibility to load using `site/blocks/example/example.yml` and `site/blocks/example/example.php`.\n\n## Install\n```\ncomposer require floriankarsten/merkur-blocks-loader\n```\nor just download the repo and put it into `site/plugins`\n\n## How to use\nPlugin doesn't require any additional setup.\nYou can change name of `blocks` directory using option `floriankarsten.merkur-blocks-loader.dirname`.\nYou can turn off caching using `floriankarsten.merkur-blocks-loader.cache`\n\n```php\n// Default settings\n[\n\t'floriankarsten.merkur-blocks-loader' =\u003e [\n\t\t'cache' =\u003e true,\n\t\t'dirname' =\u003e 'blocks'\n\t],\n]\n```\n\n\n## Caching\nThere 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`\n\n## Loading chain\nFiles loaded from `plugins` \u003c  Files loaded from `Blocks Loader` \u003c Files loaded from `default` paths\n\nWhen 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.\n\n# Ideas\n- How to make caching better?\n- Loading from multiple locations?\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffloriankarsten%2Fmerkur-blocks-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffloriankarsten%2Fmerkur-blocks-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffloriankarsten%2Fmerkur-blocks-loader/lists"}