All Projects → JimSchofield → Guty-Blocks-2

JimSchofield / Guty-Blocks-2

Licence: other
A minimal, fast development environment for WordPress Gutenberg blocks

Programming Languages

javascript
184084 projects - #8 most used programming language
PHP
23972 projects - #3 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to Guty-Blocks-2

getwid-style-kit
This boilerplate is designed for WordPress theme developers who are interested in developing themes with the new WordPress 5.x Block Editor - Gutenberg.
Stars: ✭ 33 (-36.54%)
Mutual labels:  gutenberg, gutenberg-boilerplate, gutenberg-blocks
gutenberg-workshop
⚒️ A Gutenberg Workshop 🅱️
Stars: ✭ 21 (-59.62%)
Mutual labels:  gutenberg, gutenberg-boilerplate, gutenberg-blocks
browser-shots
A WordPress plugin for taking screenshots of websites using the block editor.
Stars: ✭ 17 (-67.31%)
Mutual labels:  gutenberg, gutenberg-blocks
benenson
A Gutenberg WordPress theme
Stars: ✭ 70 (+34.62%)
Mutual labels:  gutenberg, gutenberg-blocks
caxton
Gutenberg pro
Stars: ✭ 22 (-57.69%)
Mutual labels:  gutenberg, gutenberg-blocks
gutenberg-forms
The Next Generation WordPress Form Builder.
Stars: ✭ 98 (+88.46%)
Mutual labels:  gutenberg, gutenberg-blocks
slotfill-and-filter-demos
This repo can be used as reference or can be installed as a plugin in any WordPress install to make code changes as needed. Each SlotFill or filter is explained with examples. This is meant to be a working document and will change as Gutenberg does.
Stars: ✭ 93 (+78.85%)
Mutual labels:  gutenberg, gutenberg-blocks
chatterbox
Create chat threads using WordPress Blocks inside app and device wrappers.
Stars: ✭ 18 (-65.38%)
Mutual labels:  gutenberg, gutenberg-blocks
wp-block-description-list
A wordpress gutenberg block plugin for description lists.
Stars: ✭ 17 (-67.31%)
Mutual labels:  gutenberg, gutenberg-blocks
icon-block
A simple little WordPress block that allows you add an SVG icon or graphic to your website.
Stars: ✭ 24 (-53.85%)
Mutual labels:  gutenberg, gutenberg-blocks
qubely
Qubely Blocks – Full-fledged Gutenberg Toolkit
Stars: ✭ 76 (+46.15%)
Mutual labels:  gutenberg, gutenberg-blocks
eightshift-docs
A documentation website for Eightshift open source projects
Stars: ✭ 44 (-15.38%)
Mutual labels:  gutenberg, gutenberg-boilerplate
dudestack
A toolkit for creating a new professional WordPress project with deployments. Originally based on Roots/bedrock.
Stars: ✭ 82 (+57.69%)
Mutual labels:  wordpress-boilerplate
Wordpress Bootstrap
Bootstrap in WordPress theme form - Bootstrap 3.3.1
Stars: ✭ 1,494 (+2773.08%)
Mutual labels:  wordpress-boilerplate
air
A hyper-minimal WordPress starter theme for developers built with Tailwind CSS.
Stars: ✭ 45 (-13.46%)
Mutual labels:  wordpress-boilerplate
WPKirk
A WP Bones skeleton Plugin
Stars: ✭ 28 (-46.15%)
Mutual labels:  wordpress-boilerplate
skeleton-plugin-blocks-gutenberg
No description or website provided.
Stars: ✭ 15 (-71.15%)
Mutual labels:  gutenberg
Bedrock
WordPress boilerplate with modern development tools, easier configuration, and an improved folder structure
Stars: ✭ 5,456 (+10392.31%)
Mutual labels:  wordpress-boilerplate
UpGulp
A Gulp Starter for your WordPress project
Stars: ✭ 29 (-44.23%)
Mutual labels:  wordpress-boilerplate
wp-console
A Wordpress CLI. A tool to generate boilerplate code, interact with and debug Wordpress.
Stars: ✭ 18 (-65.38%)
Mutual labels:  wordpress-boilerplate

Guty Blocks 2

This is designed to be a minimal, fast build environment for making WordPress Gutenberg blocks. Our priorities are to:

  1. Reduce time to development by making block generation and enqueuing fast
  2. Have a build that requires minimal enqueuing and minimal file size

To Use

  1. Clone into plugins folder of your WordPress instance
  2. Activate Guty blocks 2 in your WordPress admin
  3. In the terminal, go to the plugin folder guty-blocks-2
  4. Run npm install

npm run build will run the webpack build once.

npm run watch will run the webpack watcher and build when files are changed.

To generate a block

  1. In the terminal, go to the plugin folder guty-blocks-2
  2. Run node generate
  3. After you follow the prompts your block source files will be in assets/src/{block name}
  4. Make sure you either run npm run build or npm run watch
  5. Enjoy your block!

Deleting a block

You will need to delete the block folder and remove the import statements from index.js (and index.view.js if it included a view script).

Production build

Running npm run build:prod will build files as usual but will include js minification. A todo item for me is to include CSS minification as well.

Setup details

  • Instead of creating a php enqueuing function for each individual block, we import individual blocks into one index.js file and one style.css file.

  • Anything inside of a *.editor.css file is inlined in the block using webpack style-loader. It is never built into the dist folder, and it will not be seen on the front end view of the page. Anything in *.view.css files will be included in the single css file. This still results in the intended effect of editor styles overwriting view styles, and view styles being in both the editor and the view of the page.

  • React and ReactDOM are treated as external dependencies, meaning that they can be referenced in webpack builds, but are not actually included in the index.js build. This is so we don't duplicate React when we run the blocks. As a result file sizes for these built blocks are much smaller.

Block with view script

Sometimes there is a need to run a script on the viewing of a page. The build block with view script sets up a {blockname}.view.js file that will only be run on the front end of the site. Note that this only provides a place to run scripts that will run in the view, and the actual searching of the dom and attaching functionality is completely written by you.

Updates

July 11, 2019

  • Fixed lodash dependency issue
  • Added npm run build:prod to allow for js minification if desired

April 1, 2019

  • Removed some erroneous lines in index.js and index.view.js that were causing build errors

March 10, 2019

  • Include RichText
  • Include support for align
  • Don't include default styles ins css and don't include css className in edit or view
  • Updated readme regarding view blocks
  • Adding generate-template-files (? not sure why it wasn't installing before?)

Thanks

Thanks to Robert a.k.a codeBelt for creating generate-template-files which was a great way to set up block template generation!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].