Home

Awesome

PRE-DEPRECATION NOTICE

Instead of this deprecated and no longer-maintained boilerplate, I now recommend you to use my new toolkit called πŸ”₯ βš›β€ πŸ“¦ create-guten-block β†’


<table width='100%'> <tr> <td align='left' width='100%' colspan='2'> <strong>Gutenberg Boilerplate</strong><br /> An easy to understand and heavily documented️ WordPress Gutenberg Boilerplate! </td> </tr> <tr> <td> A FOSS (Free & Open Source Software) project. Maintained by <a href='https://github.com/ahmadawais'>@AhmadAwais</a>. </td> <td align='center'> <a href='https://AhmadAwais.com/'> <img src='https://i.imgur.com/Asg4d3k.png' width='100' /> </a> </td> </tr> </table>

⚑️ WordPress Gutenberg Boilerplate

Gutenberg-Boilerplate GitHub release

gutenberg-boilerpalte Build your first Gutenberg Editor block! A boilerplate to build WP Gutenberg blocks and stuff! ✊

⚑️ Getting Started

  1. βœ… Install & activate the Gutenberg WordPress plugin
  2. βœ… Then download and install/activate this Gutenberg Boilerplate plugin ← Just click this link to download.
  3. πŸ™Š All blocks added by this boilerplate are prefixed with GB as in Gutenberg-Boilerplate. Take a look at the GIFs below to see how to try 'em out.
  4. 🎯 To try the ESNext block, i.e. 02-basic-esnext go to it's directory i.e. gutenberg-boilerpalte/block/02-basic-esnext and run npm install. Make sure you have Node and npm installed. Then in the 02-basic-esnext directory run npm run dev for development or npm run build to build the production code.
  5. πŸ’― Now read the source code to learn how to build blocks. It's heavily documented.

RECOMMENDED READING: Read the blog post I wrote β†’ Gutenberg Boilerplate For Third-Party Custom Blocks.

⚑️ What Can You Learn?

This is a todo list for this boilerplate which also states the progress of what you can learn from it.

🍩 GIF Me Some Proof!

Sure thing! Here are a few examples of how you can use this WordPress plugin. When you install it after installing the Gutenberg plugin, this plugin gives you following four additional blocks.

πŸ“¦ Block #1

Build a Custom Gutenberg Block β€” with custom CSS for editor and front end.

block1

πŸ“¦ Block #2

Build a Custom Gutenberg Block β€” with ES6 or ESNext and a Webpack build process.

🎯 To try the ESNext block, i.e. 02-basic-esnext go to it's directory i.e. gutenberg-boilerpalte/block/02-basic-esnext and run npm install. Make sure you have Node and npm installed. Then in the 02-basic-esnext directory run npm run dev for development or npm run build to build the production code.

block2

πŸ“¦ Block #3

Build a Custom Gutenberg Block β€” with editable content.

block3

πŸ“¦ Block #4

Build a Custom Gutenberg Block β€” to click Tweet the contents of that block.

block3

⚑️ License & Attribution

Code is licensed under GPL v3.0. The content and documentation is copyrighted to the WordPress Gutenberg team and WGA - AhmadAwais.com (especially the content in the blog post). I am still making up my mind with how Gutenberg will fit in the WordPress core. There are so many things which are both good and bad about it. So, instead of ranting about it, I wanted to do something more productive. I went ahead, studied the source code and received a lot of help from Gutenberg project and its contributors (Matias Ventura, James Nylen, Riad Benguella, Andrew Duthie, Joen, etc.) to finally build this. I started with three different repos which now co-exist as the Gutenberg examples and added more examples and documentation, using the Gutenberg code as a reference. Thanks to the Gutenberg team for a lot of help along the way.

I also wrote about it Gutenberg Boilerplate For Third-Party Custom Blocks.


πŸ™Œ Hello, from the TheDevCouple! I (Ahmad Awais) am a Full Stack Web Developer and a regular core contributor at WordPress. My wife (Maedah Batool) is a WordPress Journalist/Dev/Core Contributor. If you'd like to get insights into professional full stack development, DevOps, WordPress community news, growing up a family, building and bootstrapping a business then subscribe to our premium newsletter called ↣ The WordPress Takeaway!


🎩 Support Ahmad's Open Source Projects!

If you'd like me to keep producing professional free and open source software (FOSS). Consider paying for an hour of my time. I'll spend two hours on open source for each contribution.


πŸ™Œ THEDEVCOUPLE PARTNERS

This open source project is maintained by the help of awesome businesses listed below. What? Read more about it β†’

<table width='100%'> <tr> <td width='500'><a target='_blank' href='https://kinsta.com/?kaid=WMDAKYHJLNJX&utm_source=TheDevCouple&utm_medium=Partner'><img src='https://on.ahmda.ws/73cedc/c' /></a></td> <td width='500'><a target='_blank' href='https://ahmda.ws/USES_WPE?utm_source=TheDevCouple&utm_medium=Partner'><img src='https://on.ahmda.ws/ff40fe/c' /></a></td> </tr> <tr> <td width='500'><a target='_blank' href='https://mythemeshop.com/?utm_source=TheDevCouple&utm_medium=Partner'><img src='https://on.ahmda.ws/3166d9/c' /></a></td> <td width='500'><a target='_blank' href='https://ipapi.com/?utm_source=TheDevCouple&utm_medium=Partner'><img src='https://d2ddoduugvun08.cloudfront.net/items/1R190r2U0p3N3L0U0b2u/ip-api.png'/></a></td> </tr> </table> <br>

Follow me πŸ‘‹ on Twitter β†’ Tweet to say Hi

<br /> <br /> <p align="center"> <strong>For anything else, tweet at <a href="https://twitter.com/MrAhmadAwais/" target="_blank" rel="noopener noreferrer">@MrAhmadAwais</a></strong> </p> <div align="center"> <p>I have released a video course to help you become a better developer β€” <a href="https://VSCode.pro/?utm_source=GitHubFOSS" target="_blank">Become a VSCode Power User β†’</a></p> <br /> <a href="https://VSCode.pro/?utm_source=GitHubFOSS" target="_blank"> <img src="https://raw.githubusercontent.com/ahmadawais/shades-of-purple-vscode/master/images/vscodeproPlay.jpg" /><br>VSCode</a>

<small><a href="https://VSCode.pro/?utm_source=GitHubFOSS" target="_blank">VSCode Power User Course β†’</a></small>

</div>