Sorry, we don't support your browser.  Install a modern browser

Blocks: store everything in `site/blocks/`

Currently, blocks are stored in several places:

Blueprint goes in site/blueprints/blocks
Snippet goes in site/snippets/blocks

If you want to have nice block previews, you have to create a plugin (e.g. site/plugins/block-previews) and create a JS and CSS file.

I would rather like to have everything related to blocks in one place, e.g. site/blocks with a subfolder per block.

📂 site
    📂 blocks
        📂 accordion
            📄 accordion.php
            📄 accordion.yml
            📄 accordion.js
            📄 accordion.css
            📄 model.php

Obviously there is a lot more to it than meets the eye, but this would be a massive improvement in terms of developer experience.

2 years ago

As workaround may be you can try Roman’s components plugin:
https://github.com/youngcut/kirby-components

2 years ago

I know that plugin, but it does not tackle the preview issue.

2 years ago