From 2c290e49c7a0499f41bea74e133bf98a1721b9b2 Mon Sep 17 00:00:00 2001 From: Ole Vik Date: Sat, 10 Apr 2021 11:28:49 +0200 Subject: [PATCH] API-alignment, metadata-key --- CHANGELOG.md | 11 +++++++++++ blueprints.yaml | 2 +- classes/Collection.php | 7 +------ classes/Collection/AbstractCollection.php | 2 +- classes/Collection/CollectionInterface.php | 2 +- classes/Data/AbstractData.php | 5 +++-- classes/Data/DataInterface.php | 4 +++- classes/Data/SSEData.php | 6 +++++- classes/Source/Source.php | 5 ++--- static-generator.php | 2 -- static-generator.yaml | 2 +- 11 files changed, 29 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ec59539..3708475 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/blueprints.yaml b/blueprints.yaml index e1beca9..7b4d26b 100644 --- a/blueprints.yaml +++ b/blueprints.yaml @@ -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. diff --git a/classes/Collection.php b/classes/Collection.php index 3c88655..daee9e3 100644 --- a/classes/Collection.php +++ b/classes/Collection.php @@ -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; diff --git a/classes/Collection/AbstractCollection.php b/classes/Collection/AbstractCollection.php index 55c00dd..b939a50 100644 --- a/classes/Collection/AbstractCollection.php +++ b/classes/Collection/AbstractCollection.php @@ -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; diff --git a/classes/Collection/CollectionInterface.php b/classes/Collection/CollectionInterface.php index 19ef67f..f4d15c9 100644 --- a/classes/Collection/CollectionInterface.php +++ b/classes/Collection/CollectionInterface.php @@ -15,7 +15,7 @@ namespace Grav\Plugin\StaticGenerator\Collection; -use Grav\Common\Page\Page; +use Grav\Common\Page\Interfaces\PageInterface as Page; /** * Collection Interface diff --git a/classes/Data/AbstractData.php b/classes/Data/AbstractData.php index 09386b6..b0ec239 100644 --- a/classes/Data/AbstractData.php +++ b/classes/Data/AbstractData.php @@ -1,4 +1,5 @@ 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'] diff --git a/classes/Source/Source.php b/classes/Source/Source.php index e7a5740..6d31379 100644 --- a/classes/Source/Source.php +++ b/classes/Source/Source.php @@ -1,4 +1,5 @@