Roots Discourse

Sage 9 Custom Gutenberg Blocks

I recently built a site on the Sage 9 theme and Gutenberg. I built custom Gutenberg blocks on the site using ahmadawais ’s plugin, which by itself was a great tool.

Switching terminal commands in the Sage 9 theme and the plugin became tiresome when building. This may be a ridiculous question but what would be the best way to include a custom Gutenberg block into the sage theme if possible?

I found @simeon’s post about adding Gutenberg styles. How to create and use a separate CSS file for Gutenberg editor in Sage 9, this is a start point maybe.

I also tried to use ACF 5 block tool, As of today it still does not seem to be working properly. I think ACF is awesome and this will be awesome when it’s up and running.

1 Like

Hey @Scott_V - I think custom blocks should be packaged as WP plugins and not as part of your theme (it sounds like you did it that way). If the workflow in the terminal is cumbersome, instead of merging the two projects, have you tried keeping two terminals open? Pardon me if I’m misunderstanding your question.

Thanks @mmirus, you are understanding my question. Two terminal windows would probably work. I’ve never personally run yarn and npm at the same time, on the same site because I feel like it would cause a conflict. I could be over thinking this.

Since they’re different build processes (one for the plugin and one for the theme), I’m guessing running them at the same time shouldn’t matter–but give it a shot and let us know if it works!

Its been awhile but I did try this and had no problems. I still feel like the process could be more streamlined. I’d like to try Advanced custom Fields block builder as I think I might like it more. Thanks again.

1 Like