Skip to content

Commit

Permalink
v2.0.0 (#16)
Browse files Browse the repository at this point in the history
* BREAKINGCHANGE(config): Rename menu to adminMenu
* BREAKINGCHANGE(config): Rename `categories` to `blockCategories`
* BREAKINGCHANGE(anchors): Anchors have been deprecated from Poet. If you happen to use them and see this, hit me up – I wouldn't mind whipping up a separate package.
* enhance(poet): Split Poet into modules (Fixes #10)
* enhance(poet): Refactor and improve code of project
* chore(deps): Bump dependencies
* enhance(poet): Move Collection into a trait to avoid using the global `collect()` function (Fixes #15)
* enhance(admin-menu): Rewrite Admin Menu module to not use `$GLOBALS`
* enhance(admin-menu): Allow configuring the admin page slug when moving admin menu items
* chore(ci): Move to GitHub actions
  • Loading branch information
Log1x committed Feb 17, 2021
1 parent 7585d23 commit d36d6ff
Show file tree
Hide file tree
Showing 22 changed files with 697 additions and 853 deletions.
29 changes: 0 additions & 29 deletions .circleci/config.yml

This file was deleted.

1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
/.gitattributes export-ignore
/.github export-ignore
/.circleci export-ignore
46 changes: 46 additions & 0 deletions .github/workflows/Main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Main

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
php:
name: PHP ${{ matrix.php }}
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
strategy:
matrix:
php: ['7.3', '7.4', '8.0']

steps:
- name: Checkout the project
uses: actions/checkout@v2

- name: Setup the PHP ${{ matrix.php }} environment on ${{ runner.os }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: xdebug
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Restore the Composer cache directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- uses: actions/cache@v2
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer-

- name: Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader --no-suggest

- name: Execute the PHP lint script
run: composer run-script lint
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
vendor
/vendor
99 changes: 0 additions & 99 deletions CHANGELOG.md

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 Brandon Nifong
Copyright (c) Brandon Nifong

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
20 changes: 6 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,6 @@ To modify an existing post type, simply treat it as if you are creating a new po
],
```

Optionally, Poet can also automatically add anchor `ID` attributes to post headings for configured post types by simply setting `anchor` to `true`:

```php
'post' => [
'post' => ['anchors' => true],
],
```

It is also possible to unregister an existing post type by simply passing `false`:

```php
Expand Down Expand Up @@ -223,7 +215,7 @@ Consider an accordion block that is registered with a `title` and `className` at
Poet provides an easy to way register, modify, and unregister Gutenberg block categories. Looking in the config, you will see a commented out example for a Call to Action category:

```php
'categories' => [
'blockCategories' => [
'cta' => [
'title' => 'Call to Action',
'icon' => 'star-filled',
Expand All @@ -236,7 +228,7 @@ This would result in a block category with a slug of `cta`. Once your block cate
In it's simplest form, you can simply pass a string:

```php
'categories' => [
'blockCategories' => [
'my-cool-blocks',
],
```
Expand All @@ -246,15 +238,15 @@ which would result in a `my-cool-blocks` category automatically converting the s
You can also specify the title by passing a value to your slug:

```php
'categories' => [
'blockCategories' => [
'my-cool-blocks' => 'Best Blocks, World.',
],
```

Like post types and taxonomies, modifying an existing block category is the same as registering one:

```php
'categories' => [
'blockCategories' => [
'layouts' => 'Sections',
'common' => ['icon' => 'star-filled'],
],
Expand All @@ -263,7 +255,7 @@ Like post types and taxonomies, modifying an existing block category is the same
You can unregister an existing block category by simply passing `false`:

```php
'categories' => [
'blockCategories' => [
'common' => false,
],
```
Expand Down Expand Up @@ -303,4 +295,4 @@ Contributing whether it be through PRs, reporting an issue, or suggesting an ide

## License

Poet is provided under the [MIT License](https://github.com/log1x/poet/blob/master/LICENSE.md).
Poet is provided under the [MIT License](LICENSE.md).
5 changes: 2 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@
}
},
"require": {
"php": ">=7.2.5",
"johnbillion/extended-cpts": "^4.4",
"caseyamcl/toc": "^3.0"
"php": "^7.3|^8.0",
"johnbillion/extended-cpts": "^4.5"
},
"require-dev": {
"squizlabs/php_codesniffer": "^3.5"
Expand Down
Loading

0 comments on commit d36d6ff

Please sign in to comment.