GithubHelp home page GithubHelp logo

isabella232 / newspack-blocks Goto Github PK

View Code? Open in Web Editor NEW

This project forked from automattic/newspack-blocks

0.0 0.0 0.0 7.84 MB

Gutenberg blocks for the Newspack project.

JavaScript 43.88% Shell 2.34% PHP 41.26% SCSS 12.52%

newspack-blocks's Introduction

Newspack Blocks

This plugin is meant to serve as a container for most Newspack Gutenberg blocks. There may be certain blocks that relate to specific functionality in other plugins, in which case they would live with the primary functionality, but besides this exception most will live in this one.

Setup

To get set up for block development, run composer install && npm install

Generating Builds

To generate a build of the current blocks, run npm run build.

To clean out the built blocks, run npm run clean.

Developing

To work on Block development and have Webpack watch your files for changes run: npm start.

Linting

is performed on changed files before commiting. In other words, is run during pre-commit git hook, but only on staged files. The hook is configured in composer.json.

PHP JS SCSS
tool PHPCS eslint stylelint
config .phpcs.xml.dist .eslintrc.js .stylelintrc
run manually ./vendor/bin/phpcs <file> npm run lint:js npm run lint:scss
autofix โœจ ./vendor/bin/phpcbf <file> npm run lint:js -- --fix npm run lint:scss -- --fix

Building new Blocks

To get started with a new block:

  • Duplicate one of the example block directories in src/
  • Rename the directory to the slug of your block.
  • At minimum edit index.js and change name and title definitions.
  • Add the block slug to the production array in src/setup/blocks.json
  • If the block requires server-side code add the slug to the $newspack_blocks_blocks array in newspack-blocks.php
  • Execute npm run build. If all went smoothly, you should see a Newspack category in the block picker, and your block should appear within it.

newspack-blocks's People

Contributors

laurelfulford avatar claudiulodro avatar thomasguillot avatar jeffersonrabb avatar adekbadek avatar obenland avatar retrofox avatar ockham avatar marekhrabe avatar josephscott avatar dependabot[bot] avatar wunderbart avatar philipjohn avatar mkaz avatar arcangelini avatar frontdevde avatar akirk avatar apeatling avatar aurorum avatar getdave avatar dkoo avatar felixarntz avatar glendaviesnz avatar jeryj avatar sirreal avatar nielslange avatar p-jackson 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.