Sage 9 Custom Gutenberg Blocks

sage9

#1

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, https://www.advancedcustomfields.com/blog/the-state-of-acf-in-a-gutenberg-world/. As of today it still does not seem to be working properly. https://support.advancedcustomfields.com/forums/topic/acf-5-7-2-pro-wont-give-block-as-a-location-option/. I think ACF is awesome and this will be awesome when it’s up and running.


#2

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.


#3

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.


#4

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!