Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-j-m committed Dec 16, 2020
2 parents e330409 + c3cad35 commit 0550e1f
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 15 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# v2.1.0
## 15-12-2020

1. [](#new)
* Added support for flex pages in Grav 1.7

# v2.0.2
## 03-11-2020

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ There are only two required fields to complete to get up and running: Organizati

## Usage

Global settings are configured at the plugin level as described above. These values are constant for each page of your site e.g. Oranization name, logo and social account details.
Global settings are configured at the plugin level as described above. These values are constant for each page of your site e.g. Organization name, logo and social account details.

There is an additional configuration tab titled `Aura` available on each page in the page editor. This is where to set page specific information such as the meta description. Other than meta description, data required at a page level (URL, title etc.) will be automatically inferred from Grav's internal system settings.

Expand Down
12 changes: 2 additions & 10 deletions aura.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
namespace Grav\Plugin;

use Grav\Common\Plugin;
use Grav\Common\Page\Page;
use Grav\Common\Flex\Types\Pages\PageObject;
use RocketTheme\Toolbox\Event\Event;
use Grav\Common\Utils;
use Grav\Plugin\Aura\Aura;
Expand Down Expand Up @@ -33,11 +33,6 @@ public static function getSubscribedEvents()
public function onPluginsInitialized()
{

// Don't proceed if php ext-json is not available
if (!function_exists('json_encode')) {
return;
}

spl_autoload_register(function ($class) {
if (Utils::startsWith($class, 'Grav\Plugin\Aura\\')) {
require_once __DIR__ .'/classes/' . strtolower(basename(str_replace("\\", '/', $class))) . '.php';
Expand Down Expand Up @@ -73,10 +68,7 @@ public function onGetPageBlueprints($event)
public function onAdminSave(Event $event)
{

//file_put_contents('/tmp/myfile', print_r($event, true));

// Don't proceed if Admin is not saving a Page
if (!$event['object'] instanceof Page) {
if (!$event['object'] instanceof PageObject) {
return;
}

Expand Down
7 changes: 6 additions & 1 deletion blueprints.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: Aura
version: 2.0.2
slug: aura
type: plugin
version: 2.1.0
description: Automatically add meta tags and structured data to your pages for visually appealing and informative search results and social media sharing.
icon: code
author:
Expand All @@ -11,6 +13,9 @@ keywords: seo, structured data, open graph
bugs: https://github.com/matt-j-m/grav-plugin-aura/issues
license: MIT

dependencies:
- { name: grav, version: '>=1.7.0' }

form:
validation: strict
fields:
Expand Down
4 changes: 1 addition & 3 deletions classes/aura.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
namespace Grav\Plugin\Aura;

use Grav\Common\Grav;
use Grav\Common\Page\Page;
use Grav\Plugin\AuraAuthorsPlugin;

class Aura
{
Expand All @@ -29,7 +27,7 @@ class Aura
* @param object $page
*
*/
public function __construct(Page $page)
public function __construct($page)
{

$this->grav = $cache = Grav::instance();
Expand Down
37 changes: 37 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "matt-j-m/grav-plugin-aura",
"type": "grav-plugin",
"description": "Automatically add meta tags and structured data to your pages for visually appealing and informative search results and social media sharing.",
"keywords": ["seo", "structured data", "open graph"],
"homepage": "https://github.com/matt-j-m/grav-plugin-aura",
"license": "MIT",
"authors": [
{
"name": "Matt Mulhall",
"email": "[email protected]",
"homepage": "https://www.theskylab.net",
"role": "Developer"
}
],
"support": {
"issues": "https://github.com/matt-j-m/grav-plugin-aura/issues",
"docs": "https://github.com/matt-j-m/grav-plugin-aura/blob/master/README.md"
},
"require": {
"php": ">=7.1.3",
"ext-json": "*"
},
"autoload": {
"psr-4": {
"Grav\\Plugin\\Aura\\": "classes/"
},
"classmap": [
"aura.php"
]
},
"config": {
"platform": {
"php": "7.1.3"
}
}
}

0 comments on commit 0550e1f

Please sign in to comment.