Giter Site home page Giter Site logo

benjaminluoma / wordpress-blocks-starter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from them-es/wordpress-blocks-boilerplate

0.0 1.0 0.0 20 KB

A WordPress "Gutenberg" blocks boilerplate.

Home Page: https://them.es

License: GNU General Public License v2.0

PHP 31.28% JavaScript 68.72%

wordpress-blocks-starter's Introduction

them.es WordPress Blocks

them.es WordPress Blocks is a WordPress "Gutenberg" blocks boilerplate which can be included in a theme.

What's included?

  • Gutenberg blocks configuration tested in WordPress v5.8+
  • The legacy boilerplate which is compatible with WordPress <5.8 can be found in the "v1" branch
  • NPM configuration
  • ESNext
  • Support for a category where all custom blocks can be organized
  • A simple "Hello world" block implementation is included
  • Optional: Easily add more blocks

Setup

  • Prerequisites: Node.js (NPM) needs to be installed on your system
  • Download the source code of this repository to a new directory (e.g. /blocks) in your WordPress theme
  • Add the following code snippet to functions.php in your theme (or plugin)
$theme_blocks = __DIR__ . '/blocks/index.php';
if ( is_readable( $theme_blocks ) ) {
	require_once $theme_blocks;
}
  • Open /blocks in Terminal and install the required Node.js dependencies
  • $ npm install
  • A simple Hello world block implementation is included to get you started. More examples can be found in the official Gutenberg examples repository
  • You can easily include additional blocks by duplicating /src/block# and referencing the new block(s) in /src/index.js
  • Run the start script
  • $ npm run start
  • Develop the block(s) by modifying /src/block#/index.js - the official Gutenberg Handbook may help you learn how to build blocks
  • When you're done run the build script to create a minified version of your blocks
  • $ npm run build
  • Now you can test the block(s) in the WordPress Editor

Technology

Copyright & License

Code and Documentation © them.es

Code released under GPLv2+

wordpress-blocks-starter's People

Contributors

them-es avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.