-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#129] Auto Create Blocks #134
Conversation
b29f78b
to
2fc6f09
Compare
We may need to adjust/update this as we update our WP Site Starter blocks, but this is a start. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! I hadn't heard about plop before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is really cool and has a lot of potential to make Site Starter actions a lot easier to do!! Good find with Plop! I'd love to explore other ways we can use it too!
One thing I didn't mention in my comments, but wanted to bring up is that I'd like to try to move away from loading a pattern default as innerBlocks
and use the block templating, it just seems to work better in more situations, even though it's more difficult to create. Maybe something to discuss later.
In order build a new block run: | ||
|
||
``` | ||
ddev npm run plop block |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing that would be cool would be to set up a simple custom command in ddev
like ddev create-block
that can be run anywhere in the project, that automatically executes from the theme directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that would be nice. I will look into that.
@bd-viget I am going to update the inner blocks part in my block refactor PR. |
Summary
This adds plop which allows us to auto build block files from the templates. We ask several questions and then build all the files.
Issues
Testing Instructions
ddev restart
wp-content/themes/wp-starter
ddev npm run plop block
orddev npm run plop
- running withoutblock
plop will default to the first generator which isblock
.Screenshots