Skip to content

Commit

Permalink
Merge branch 'release/1.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubmikita committed Jan 30, 2020
2 parents e2f7993 + 41acf9d commit 3422cff
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 46 deletions.
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
* text eol=lf
*.gif -text
*.ico -text
*.jpg -text
*.pdf -text
*.png -text
*.psd -text
*.webp -text
Binary file added .github/assets/usage-demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 12 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This package will automatically create a block template file with basic markup f
## 💾 Installation

``` bash
composer require micropackage/acf-block-creator
composer require --dev micropackage/acf-block-creator
```

## 🕹 Usage
Expand All @@ -34,8 +34,11 @@ Micropackage\ACFBlockCreator\ACFBlockCreator::init( [
```

Only thing to do is to create new ACF field group which name starts with "Block:". It will automatically create a block template file and set the field group location to this created block.

Block params (block name, slug, category etc.) can be adjusted using additional fields at the bottom of field group creation form.

![ACF Block Creator demo](./.github/assets/usage-demo.gif?raw=true)

### Silent initialization

Since this is a development package and is not useful in production environment we probably don't want it's initialization code in the production package of our theme.
Expand All @@ -51,48 +54,16 @@ If you configure a custom category it will also be automatically used as default
## ⚙️ Configuration
All parameters are optional.

### blocks_dir
**string**

Directory inside the theme for block templates.

**Default:** `'blocks'`

### scss_dir
**false|string**

Directory inside the theme for block sass styles file.
If set, the empty scss file will be created for each block in this directory.

**Default:** `false`

### default_category
**string**

Default category for new blocks.

**Default:** `'common'`

### block_container_class
**string**

Optional class for wrapping `<div>` element inside the block template.

**Default:** `'block-inner'`

### package
**boolean|string**

String containing package name for file block comment. If set to true, WordPress site name will be used. If false, no `@package` comment will be added.

**Default:** `true`

### license
**false|string**
| Parameter | Type | Description |
| ------------------------- | ----------------- | ------------------------------------------------------------ |
| **blocks_dir** | (*string*) | Directory inside the theme for block templates.<br />**Default:** `'blocks'` |
| **scss_dir** | (*false\|string*) | Directory inside the theme for block sass styles file.<br/>If set, the empty scss file will be created for each block in this directory.<br/>**Default:** `false` |
| **default_category** | (*string*) | Default category for new blocks.<br/>**Default:** `'common'` |
| **block_container_class** | (*string*) | Optional class for wrapping `<div>` element inside the block template.<br/>**Default:** `'block-inner'` |
| **package** | (*bool\|string*) | String containing package name for file block comment. If set to true, WordPress site name will be used. If false, no `@package` comment will be added.<br/>**Default:** `true` |
| **license** | (*false\|string*) | String containing license name for file block comment. If set to false no `@license` comment will be added.<br/>**Default:** `'GPL-3.0-or-later'` |

String containing license name for file block comment. If set to false no `@license` comment will be added.

**Default:** `'GPL-3.0-or-later'`

## 📦 About the Micropackage project

Expand Down
10 changes: 5 additions & 5 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3422cff

Please sign in to comment.