0.1.1 • Published 1 year ago

@carstenbach/postmeta-block-template v0.1.1

Weekly downloads
-
License
GPL-3.0-or-later
Repository
github
Last release
1 year ago

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

  1. This block template can be used by running the following command:
    npx  @wordpress/create-block --template @carstenbach/postmeta-block-template
  1. Find & Replace all occurences of POSTMETA with the snake_cased meta_key of your post_meta inside of the newly created:

    • {postmeta-block}.php
    • src/edit/index.js
  2. 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/