Skip to content

Commit 6321eb1

Browse files
committed
WDSBT-20 - Update README
1 parent 1ba9923 commit 6321eb1

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

โ€ŽREADME.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
- [Getting Started](#getting-started)
1818
- [Development](#development)
1919
- [NPM Scripts](#npm-scripts)
20+
- [Creating Custom Blocks](#creating-blocks)
2021
- [Customizations](#customizations)
2122
- [Implementation](#implementation)
2223
- [Mixins](#mixins)
@@ -205,6 +206,7 @@ npm run setup
205206
|-------|---------|-------------|
206207
| ๐ŸŒ | `npm run a11y` | Run accessibility tests using Pa11y-CI. |
207208
| ๐Ÿ› ๏ธ | `npm run build` | Build the theme using `wp-scripts`. |
209+
| ๐Ÿ”จ | `npm run create-block` | Create a custom block with Webpack and @wordpress/create-block. |
208210
| ๐Ÿ“ | `npm run format` | Format files using `wp-scripts` and `composer`. |
209211
| ๐Ÿ” | `npm run lint` | Run all linting scripts. |
210212
| ๐ŸŽจ | `npm run lint:css` | Lint CSS files using `wp-scripts`. |
@@ -218,6 +220,30 @@ npm run setup
218220
| โ–ถ๏ธ | `npm run start` | Start the development server using `wp-scripts`. |
219221

220222

223+
[๐Ÿ” Back to Top](#wds-bt)
224+
***
225+
226+
## Creating Blocks
227+
228+
1. Run the Block Creation Script
229+
Navigate to your project root in the terminal and run the following command to create a new block:
230+
231+
```bash
232+
npm run create-block
233+
```
234+
235+
Follow the prompts to configure your new block. The script will scaffold a new block structure inside assets/blocks/.
236+
237+
2. Build your block
238+
After editing and configuring your block, build your project to compile assets using webpack:
239+
240+
```bash
241+
npm run build
242+
```
243+
This will process JavaScript, SCSS, optimize images, and generate necessary files in the build/ directory and custom blocks will have files generated in the blocks/ directory.
244+
245+
246+
221247
[๐Ÿ” Back to Top](#wds-bt)
222248
***
223249

0 commit comments

Comments
ย (0)