thoughtis / cata-blocks

Block Editor components for use with the Cata theme.
GNU General Public License v3.0
1 stars 0 forks source link

Cata Blocks

Block Editor components for use with the Cata theme.

How To Build

Navigate to a component's folder and run npm run build.

Example:

cd blocks/aside
npm run build

Components

Blocks

Aside

An <aside> element with InnerBlocks.

Kicker

A <p> element styled to reduce the margin of the element immediately after it.

Newsletter

A <form> for MailChimp newsletter sign ups.

Table of Contents

A <details> element populated with links to Heading 2's (<h2>'s) in the post body.

Patterns

Trivia

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.

Separation of Concerns

How To Add A Block

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.