-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
28 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
# v1.0.1 | ||
## 08/21/2015 | ||
|
||
3. [](#bugfix) | ||
* Fixed missing Twig update routines | ||
|
||
# v1.0.0 | ||
## 08/20/2015 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php | ||
/** | ||
* Themer v1.0.0 | ||
* Themer v1.0.1 | ||
* | ||
* This plugin enables you to use different themes on one site | ||
* individual set per page or collection. | ||
|
@@ -9,7 +9,7 @@ | |
* http://benjamin-regler.de/license/ | ||
* | ||
* @package Themer | ||
* @version 1.0.0 | ||
* @version 1.0.1 | ||
* @link <https://github.com/sommerregen/grav-plugin-themer> | ||
* @author Benjamin Regler <[email protected]> | ||
* @copyright 2015, Benjamin Regler | ||
|
@@ -21,6 +21,7 @@ | |
|
||
use Grav\Common\Plugin; | ||
use Grav\Common\Page\Page; | ||
use Grav\Common\Twig\TraceableTwigEnvironment; | ||
|
||
/** | ||
* ThemerPlugin | ||
|
@@ -77,6 +78,24 @@ public function onPageInitialized() | |
|
||
// Reload themes to reflect changes | ||
$this->grav['themes']->init(); | ||
|
||
// Silent DebugBar error :: 'twig' is already a registered collector | ||
if ($debug = $this->config->get('system.debugger.twig', false)) { | ||
$this->config->set('system.debugger.twig', false); | ||
} | ||
|
||
// Reset and re-initialize Twig environment | ||
$twig = $this->grav['twig']; | ||
$twig->twig = null; | ||
$twig->twig_paths = []; | ||
$twig->init(); | ||
|
||
// Update TwigCollector for DebugBar | ||
if ($debug) { | ||
$twig->twig = new TraceableTwigEnvironment($twig->twig); | ||
$collector = $this->grav['debugger']->getCollector('twig'); | ||
$collector->twig = $twig->twig; | ||
} | ||
} | ||
} | ||
} | ||
|