Block Editor components for use with the Cata theme.
Navigate to a component's folder and run npm run build
.
Example:
cd blocks/aside
npm run build
An <aside>
element with InnerBlocks
.
A <p>
element styled to reduce the margin of the element immediately after it.
A <form>
for MailChimp newsletter sign ups.
A <details>
element populated with links to Heading 2's (<h2>
's) in the post body.
An aside block containing a kicker as the title, paragraph for the question and a paragraph for the answer.
The answer is wrapped in the Tap To Reveal format. This format needs to be moved into Cata Blocks from Creepy Catalog.
WordPress has a create-block
script for this.
https://developer.wordpress.org/block-editor/reference-guides/packages/packages-create-block/
But, it acts like each block is its own plugin. It's not optimized for the way we're doing it where all the blocks are in one plugin. So here's how to do it.
cd blocks
npx @wordpress/create-block --no-wp-scripts my-cool-block-name
cd my-cool-block-name
rm -r node_modules
rm package-lock.json readme.txt
../../node_modules/.bin/wp-scripts build
cata-blocks.php
require_once __DIR__ . '/blocks/my-cool-block-name/my-cool-block-name.php';