greenpeace/planet4-gpch-plugin-blocks

Provides Planet4 content blocks specific to Greenpeace Switzerland

Installs: 1 851

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 7

Forks: 1

Open Issues: 9

Type:wordpress-plugin

v1.31 2024-04-08 14:39 UTC

This package is auto-updated.

Last update: 2024-04-08 14:40:25 UTC


README

Content Blocks, specific to the GPCH installation of Planet4.

Install

Install dependencies:

npm install --save-dev

composer install --ignore-platform-reqs

Coding Standards

Any new code added is required to implement Wordpress coding standards

Javascript: Use JSHint

Set JSHint to use .jshintrc provided in this repository.

Example for PHPStorm:

  • Settings -> Languages & Frameworks -> Javascript -> Code Quality Tools -> JSHint
  • ☑ Enable
  • ☑ Use config files
  • Location: ☑ Default

Build

Make sure your files are formatted correctly: npm run format

Make sure your files pass ESLint with the provided config: npm run lint:js

Build files for production: npm run build

Build styles: sass assets/css/source/style.scss assets/css/style.css --style=compressed

Autoloader

To generate autoload files, run composer dump-autoload

Translations

Generate and use .pot/.po/.mo files as usual. Make sure to include translations in Twig templates.

Transform po files into additional JSON for use with Javascript. See the guide in dev docs

Example: wp i18n make-json planet4-gpch-plugin-blocks-de_CH.po --no-purge

Then rename the files to use the handle instead of the auto generated md5 string in the filename.