Skip to content

Commit

Permalink
API-alignment, metadata-key
Browse files Browse the repository at this point in the history
  • Loading branch information
OleVik committed Apr 10, 2021
1 parent 99ddadb commit 2c290e4
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 19 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# v3.1.0
## 10-04-2021

1. [](#improved)
* API-alignment to use `Grav\Common\Page\Interfaces\PageInterface`, transparently
* Code cleanup
2. [](#new)
* Revert content index-location to `user://data/persist`
3. [](#bugfix)
* Correct key in indexed metadata

# v3.0.0
## 07-03-2021

Expand Down
2 changes: 1 addition & 1 deletion blueprints.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Static Generator
version: 3.0.0
version: 3.1.0
slug: static-generator
type: plugin
description: Static generation of Page(s) and Index.
Expand Down
7 changes: 1 addition & 6 deletions classes/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,10 @@
namespace Grav\Plugin\StaticGenerator;

use Grav\Common\Grav;
use Grav\Common\Plugin;
use Grav\Common\Utils;
use Grav\Common\Page\Page;
use Grav\Common\Page\Media;
use Grav\Common\Page\Header;
use RocketTheme\Toolbox\Event\Event;
use Grav\Common\Page\Interfaces\PageInterface as Page;
use Symfony\Component\Console\Helper\ProgressBar;
use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Helper\TableSeparator;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Filesystem\Exception\IOExceptionInterface;

Expand Down
2 changes: 1 addition & 1 deletion classes/Collection/AbstractCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

use Grav\Common\Grav;
use Grav\Common\Utils;
use Grav\Common\Page\Page;
use Grav\Common\Page\Interfaces\PageInterface as Page;
use Grav\Common\Page\Collection;
use Grav\Plugin\StaticGenerator\Collection\CollectionInterface;
use Grav\Plugin\StaticGenerator\Config\Config;
Expand Down
2 changes: 1 addition & 1 deletion classes/Collection/CollectionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

namespace Grav\Plugin\StaticGenerator\Collection;

use Grav\Common\Page\Page;
use Grav\Common\Page\Interfaces\PageInterface as Page;

/**
* Collection Interface
Expand Down
5 changes: 3 additions & 2 deletions classes/Data/AbstractData.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Static Generator Plugin, Abstract Data Builder
*
Expand All @@ -11,11 +12,11 @@
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link https://github.com/OleVik/grav-plugin-static-generator
*/

namespace Grav\Plugin\StaticGenerator\Data;

use Grav\Common\Grav;
use Grav\Common\Page\Page;
use Grav\Console\ConsoleCommand;
use Grav\Common\Page\Interfaces\PageInterface as Page;
use Grav\Plugin\StaticGenerator\Data\DataInterface;

/**
Expand Down
4 changes: 3 additions & 1 deletion classes/Data/DataInterface.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Static Generator Plugin, Data Builder Interface
*
Expand All @@ -11,9 +12,10 @@
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link https://github.com/OleVik/grav-plugin-static-generator
*/

namespace Grav\Plugin\StaticGenerator\Data;

use Grav\Common\Page\Page;
use Grav\Common\Page\Interfaces\PageInterface as Page;

/**
* Data Builder Interface
Expand Down
6 changes: 5 additions & 1 deletion classes/Data/SSEData.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,11 @@ public function teardown(string $location, string $slug, array $data, Timer $Tim
if ($Storage->doHas($file)) {
$Storage->doDelete($file);
}
$Storage->doSet($file, 'const GravDataIndex = ' . json_encode($data) . ';', 0);
if ($this->content) {
$Storage->doSet($file, 'const GravDataIndex = ' . json_encode($data) . ';', 0);
} else {
$Storage->doSet($file, 'const GravMetadataIndex = ' . json_encode($data) . ';', 0);
}
$message = ucfirst(
$this->grav['language']->translate(
['PLUGIN_STATIC_GENERATOR.ADMIN.GENERIC.STORED']
Expand Down
5 changes: 2 additions & 3 deletions classes/Source/Source.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Static Generator Plugin, Source Manipulator
*
Expand All @@ -11,12 +12,10 @@
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link https://github.com/OleVik/grav-plugin-static-generator
*/

namespace Grav\Plugin\StaticGenerator\Source;

use Grav\Common\Utils;
use Grav\Common\Page\Page;
use Grav\Common\Page\Pages;
use Grav\Common\Page\Media;

/**
* Source Manipulator
Expand Down
2 changes: 0 additions & 2 deletions static-generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
use Grav\Common\Plugin;
use Grav\Common\Utils;
use Grav\Common\Inflector;
use Grav\Common\Page\Pages;
use Grav\Common\Page\Page;
use Grav\Framework\File\YamlFile;
use Grav\Framework\File\Formatter\YamlFormatter;
use RocketTheme\Toolbox\Event\Event;
Expand Down
2 changes: 1 addition & 1 deletion static-generator.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
enabled: true
index: "user://data/persist"
content: "user://data/persist/static"
content: "user://data/persist"
content_max_length: 100000
content_permissions:
- admin.super
Expand Down

0 comments on commit 2c290e4

Please sign in to comment.