BlackbirdDigital / wp-theme-scaffold

Blackbird's WordPress Theme Scaffold

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Create block templates for different block types

cr0ybot opened this issue · comments

We have at least 3 different kinds of blocks we create often:

  1. Static, vanilla JS
  2. Dynamic, vanilla JS with PHP render on front-end
  3. ACF, new formula that uses block.json

Ideally, we could create templates for these 3 block types and put them somewhere in the scaffolding that could then be utilized by an npm command to scaffold a block.

Something like:

npx @wordpress/create-block --template ./path/to/template-directory --no-plugin

We should be able to add the command to scripts in package.json in order to point to the correct template path and block src path.

See https://developer.wordpress.org/block-editor/reference-guides/packages/packages-create-block/