Content Blocks, specific to the GPCH installation of Planet4.
Install dependencies:
npm install --save-dev
composer install --ignore-platform-reqs
Any new code added is required to implement Wordpress coding standards
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
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
To generate autoload files, run
composer dump-autoload
- Generate .pot files: Use wp-cli or PoEdit. PoEdit is the preferred option as it reads strings from all files including Twig templates.
- Create the .po and .mo files for each language using Poedit
- Transform the po files into additional JSON for use with Javascript.
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.