@carstenbach/postmeta-block-template
v0.1.1
Published
Spin up a dynamic block to show specific postmeta as server-side-rendered block, using this template for the WordPress/create-block package.
Downloads
10
Maintainers
Readme
A create-block template for a dynamic block using postmeta
Spin up a dynamic block to show specific post_meta as a RichText comnponent. Use this package as a template for the @wordpress/create-block
script.
Usage
This block template can be used by running the following command:
npx @wordpress/create-block --template @carstenbach/postmeta-block-template
Find & Replace all occurences of
POSTMETA
with the snake_casedmeta_key
of your post_meta inside of the newly created:{postmeta-block}.php
src/edit/index.js
Run
npm run build
Structure
Once the command has completed, the following structure will be created:
.
├── block.json
├── build
│ ├── index.asset.php
│ ├── index.js
│ ├── index.js.map
│ ├── style-index.css
│ └── style-index.css.map
├── languages
│ └── {postmeta-block}.pot
├── package.json
├── package-lock.json
├── {postmeta-block}.php
├── readme.txt
└── src
├── edit
│ ├── editor.scss
│ ├── index.js
│ ├── level-icon.js
│ └── level-toolbar.js
├── index.js
├── save.js
└── style.scss
About
This template is based on https://github.com/mkaz/mkaz-block-template and its related blog post for details: https://mkaz.blog/wordpress/make-your-own-create-block-templates/