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
-
Install PHP dependencies (downloads SEO plugins into
.wp-env/plugins/):composer install
-
Start the WordPress environment:
npm run env:start
Yoast SEO, Rank Math, and SEOPress are mounted automatically via
.wp-env.json.
npm run build- Build the blocks for productionnpm run start- Start the development server with hot reloadnpm run env:start- Start the WordPress environment (wp-env)npm run env:stop- Stop the WordPress environment
FAQ structured data (JSON-LD) requires Yoast SEO, Rank Math, or SEOPress. All three plugins are available in the local wp-env environment; keep only one active in the WordPress admin when testing a specific integration. SEO plugin files are not versioned in the repository (installed via Composer into .wp-env/plugins/).
- 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