A Gutenberg block for SEO friendly FAQ in an accessible accordion.
- Node.js 20.12.0 (managed by Volta)
- Docker (for wp-env)
-
Clone the repository
-
Install dependencies:
npm install
-
Build the blocks:
npm run build
-
Start the WordPress environment and install Yoast SEO:
npm run setup:env
Note: On Windows, you may need to run the commands separately:
npm run start:env # Wait for WordPress to be ready (about 10-15 seconds) npm run setup
npm run build- Build the blocks for productionnpm run start- Start the development server with hot reloadnpm run start:env- Start the WordPress environment (wp-env)npm run stop:env- Stop the WordPress environmentnpm run install:yoast- Install and activate Yoast SEO plugin (required for schema generation)npm run setup:env- Start wp-env and install Yoast SEO in one command
Yoast SEO is required for the FAQ schema (JSON-LD) generation. It is installed automatically via npm run setup:env but is not versioned in the repository.
- initial commit.
- fix css variable names
- Add support for PHP 8.2
- Major block structure refactoring : Transition from a monolithic block to a nested architecture with child blocks (
faq-item,faq-question,faq-answer) - Configurable accordion mode : Added
isAccordionattribute allowing to toggle between an interactive accordion mode and a static mode - InnerBlocks support in answers : Ability to add any Gutenberg block (lists, paragraphs, images, etc.) in FAQ answers
- Front-end JavaScript : Added
script.jsto handle accordion interactivity on the front-end with customizable configuration via thebeapi_faq_block_configfilter - Automatic migration : Migration system from the old format (
questionsarray attribute) to the new format (InnerBlocks) - Complete internationalization : Support for PO/MO translations for PHP and JSON for JavaScript
- Aligned build structure : Reorganization to follow the
blockparty-accordionmodel withblock.jsonin each block directory - Add/remove buttons : Added buttons to add and remove FAQ items directly from the editor
- Fix build blocks
- Add missing isAccordion attribute
- Allow adding "Button" blocks in the answer content
- Add spacing support for answers
- Add font size support for the question
- Strip HTML tags from the question in structured data