# @carstenbach/postmeta-block-template

> Spin up a dynamic block to show specific postmeta as server-side-rendered block, using this template for the WordPress/create-block package.

Latest version **0.1.1** (published 2023-01-15) · GPL-3.0-or-later license · 0 weekly downloads

## Install

```sh
npm install @carstenbach/postmeta-block-template
pnpm add @carstenbach/postmeta-block-template
yarn add @carstenbach/postmeta-block-template
bun add @carstenbach/postmeta-block-template
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2023-01-15 |
| First published | 2023-01-14 |
| Weekly downloads | 0 |
| License | GPL-3.0-or-later |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 17.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Carsten Bach |
| Maintainers | carstenbach |
| Keywords | wordpress, create block, block template, scaffold |

## Links

- npm: https://www.npmjs.com/package/@carstenbach/postmeta-block-template
- Repository: https://github.com/carstingaxion/postmeta-block-template
- Issues: https://github.com/carstingaxion/postmeta-block-template/issues
- npm.io page: https://npm.io/package/@carstenbach/postmeta-block-template

## Dependencies (1)

- [@wordpress/create-block](https://npm.io/package/@wordpress/create-block.md) ^4.8.0

## Recent versions

- 0.1.1 (latest) — 2023-01-15
- 0.1.0 — 2023-01-14

## 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`](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-create-block/) script.

## Usage

1. This block template can be used by running the following command:
    ```bash
    npx  @wordpress/create-block --template @carstenbach/postmeta-block-template
    ```


2. 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`

3. Run 
    ```bash
    npm run build
    ```

## Structure

Once the command has completed, the following structure will be created:
```bash
.
├── 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/

---
_Source: https://npm.io/package/@carstenbach/postmeta-block-template · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
