We recommend that you install DustPress component with Composer, but it is also possible to do it manually.
$ git clone devgeniem/dustpress-component-boilerplate
Or add it into your composer.json
{
"require": {
"devgeniem/dustpress-component-boilerplate": "*"
}
}
description: describe plugin main functionalities
- activate parent plugin devgeniem/dustpress-components plugin
- create advanced custom fields clone field -- clone field "dpc_flexible_field"
- add your own component plugin
├── assets/
│ ├── scripts/
│ │ ├── main.js
│ │ └── plugin.js
│ └── styles/
│ ├── main.scss
│ ├── _defaults.scss
│ ├── _colors.scss
│ ├── _utils.scss
│ └── _gc-component-name.scss
├── dist/
│ ├── plugin.js
│ └── plugin.css
├── languages/
│ ├── component-textdomain.pot
│ ├── fi.po
│ └── fi.mo
├── node_modules/
│ └── ...
├── component-componentname.dust
├── composer.json
├── package.json
├── plugin.php
├── readme.md
└── webpack.config.js
Create same name dust template in project folder
run npm
npm install
run webpack to compile assets
webpack
Develope component specific sass files
- set component text domain in plugin header
Text Domain: dpc-component-name
- translate component labels
- Scan component for translatable strings
- Name files likewise
pot-file: component-textdomain.pot
po-file: fi.po
mo-file: fi.mo