Overriding the files generated by HTML To Gutenberg
By default, HTML To Gutenberg automatically generates the following files for each block found in your input directory:
index.js
edit.js
block.json
render.php
However, you can override any of these files by simply placing specially named files alongside the corresponding .html
source file.
To override a file, create a new file with the following format:
[block-slug].[filename].[extension]
For example, if you have a block defined in blocks/hero.html
, you can override its generated render.php
file by creating:
blocks/hero.render.php
Similarly, you can override:
blocks/hero.index.js
blocks/hero.edit.js
blocks/hero.block.json
These files will be copied as-is into the block's output folder and will not be overwritten by the generator.