Block Acorn
Boilerplate for building WordPress server-rendered blocks using Acorn (Laravel-style), Livewire, and acorn-fse-helper.
by Your Name · github.com/shadigaafar/wp-acron-blocks-boilerplate · website
★ 0stars
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/shadigaafar/wp-acron-blocks-boilerplate/archive/refs/heads/main.zipWordpress Acorn Blocks Boilerplate
Boilerplate for building WordPress server-rendered blocks using Acorn (Laravel-style), Livewire, and acorn-fse-helper.
Example project structure:
acorn-blocks/
├─ acorn-blocks.php
├─ composer.json
├─ blocks/ # block.json, edit.js, index.js per block
│ ├─ hero/
│ │ └─ block.json
│ ├─ testimonial/
│ │ └─ block.json
│ └─ counter/
│ └─ block.json
├─ app/Blocks/
│ ├─ Hero.php # The block Class.
│ ├─ Testimonial.php
│ └─ Counter.php
├─ resources/views/blocks
| ├─ hero.blade.php
| ├─ testimonial.blade.php
| └─ counter.blade.php
└─ assets/
├─ hero.js
├─ testimonial.js
└─ counter.js
Requirements
- PHP, Composer, Node.js + npm/yarn
- WordPress with Acorn available (or locally via the included
vendor/bin/acorn)
Installation
- Install PHP dependencies:
composer install
- Install JS dependencies and build assets:
npm install
npm run dev # or `npm run build` for production
- Generate an application key required by Livewire / Acorn:
wp acorn key:generate
- Generate Storage (make sure first the plugin is running and activated on Wordpress):
wp acorn acorn:init storageTesting and viewing blocks
Blocks appear in the WordPress editor's block inserter — select a block and add it to a post or page.
Development
- Use Acorn's commands via
wp acornor the bundledvendor/bin/acornwhen WordPress is available. Acorn expect this plugin to be up and running in Wordpress enviroment for the command to run. - Edit blocks under
blocks/and server-rendered templates underresources/views/blocks/.
Logging
- The logging configuration is in config/logging.php.
- Logs may be written to
storage/logs/(Laravel-style) or the top-levellogs/folder depending on configuration. - To enable daily log rotation, set the channel in config/logging.php to
dailyand configuredaysas needed. - Tail logs locally:
tail -f storage/logs/laravel.log
Contributing
- Open issues and pull requests are welcome. Keep changes focused and documented.