diff --git a/system/config/site.yaml b/system/config/site.yaml index 1142a5dd2..bb2ee6e86 100644 --- a/system/config/site.yaml +++ b/system/config/site.yaml @@ -3,7 +3,7 @@ default_lang: en # Default language for site (potenti author: name: John Appleseed # Default author name - email: 'john@email.com' # Default author email + email: 'john@example.com' # Default author email taxonomies: [category,tag] # Arbitrary list of taxonomy types diff --git a/system/src/Grav/Common/Helpers/Truncator.php b/system/src/Grav/Common/Helpers/Truncator.php index b2a19dbc2..474aae1bc 100644 --- a/system/src/Grav/Common/Helpers/Truncator.php +++ b/system/src/Grav/Common/Helpers/Truncator.php @@ -113,7 +113,7 @@ class Truncator { if ($letters->key() >= $limit) { $currentText = $letters->currentTextPosition(); - $currentText[0]->nodeValue = substr($currentText[0]->nodeValue, 0, $currentText[1] + 1); + $currentText[0]->nodeValue = mb_substr($currentText[0]->nodeValue, 0, $currentText[1] + 1); self::removeProceedingNodes($currentText[0], $body); if (!empty($ellipsis)) { diff --git a/system/src/Grav/Common/Page/Medium/ImageMedium.php b/system/src/Grav/Common/Page/Medium/ImageMedium.php index a1a544a3c..719d55389 100644 --- a/system/src/Grav/Common/Page/Medium/ImageMedium.php +++ b/system/src/Grav/Common/Page/Medium/ImageMedium.php @@ -308,6 +308,8 @@ class ImageMedium extends Medium $derivative->set('width', $width); $derivative->set('height', $height); + $derivative->saveImage(); + $derivative->resetImage(); $this->addAlternative($ratio, $derivative); } } @@ -566,6 +568,14 @@ class ImageMedium extends Medium return $this; } + /** + * Frees the cached image file. + */ + protected function resetImage() + { + $this->image = null; + } + /** * Save the image with cache. * @@ -594,7 +604,9 @@ class ImageMedium extends Medium $this->image->merge(ImageFile::open($overlay)); } - return $this->image->cacheFile($this->format, $this->quality); + $cachedPath = $this->image->cacheFile($this->format, $this->quality); + $this->set('filepath', $cachedPath); + return $cachedPath; } /** diff --git a/system/src/Grav/Common/Page/Page.php b/system/src/Grav/Common/Page/Page.php index 711f99739..cfdffe3e6 100644 --- a/system/src/Grav/Common/Page/Page.php +++ b/system/src/Grav/Common/Page/Page.php @@ -2976,4 +2976,26 @@ class Page implements PageInterface return $route; } } + + /** + * Gets the Page Unmodified (original) version of the page. + * + * @return Page + * The original version of the page. + */ + public function getOriginal() + { + return $this->_original; + } + + /** + * Gets the action. + * + * @return string + * The Action string. + */ + public function getAction() + { + return $this->_action; + } } diff --git a/system/src/Grav/Common/Twig/Twig.php b/system/src/Grav/Common/Twig/Twig.php index 60024b5ff..92635a729 100644 --- a/system/src/Grav/Common/Twig/Twig.php +++ b/system/src/Grav/Common/Twig/Twig.php @@ -241,7 +241,9 @@ class Twig // Process Modular Twig if ($item->modularTwig()) { $twig_vars['content'] = $content; - $template = $item->template() . TEMPLATE_EXT; + $extension = $this->grav['uri']->extension(); + $extension = $extension ? ".{$extension}.twig" : TEMPLATE_EXT; + $template = $item->template() . $extension; $output = $content = $local_twig->render($template, $twig_vars); } diff --git a/user/config/site.yaml b/user/config/site.yaml index c45818de4..4be78edc9 100644 --- a/user/config/site.yaml +++ b/user/config/site.yaml @@ -1,7 +1,7 @@ title: Grav author: name: Joe Bloggs - email: 'joe@test.com' + email: 'joe@example.com' metadata: description: 'Grav is an easy to use, yet powerful, open source flat-file CMS' diff --git a/webserver-configs/nginx.conf b/webserver-configs/nginx.conf index 0696c8439..89dd1051e 100644 --- a/webserver-configs/nginx.conf +++ b/webserver-configs/nginx.conf @@ -30,7 +30,8 @@ server { ## Begin - PHP location ~ \.php$ { # Choose either a socket or TCP/IP address - fastcgi_pass unix:/var/run/php5-fpm.sock; + fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; + # fastcgi_pass unix:/var/run/php5-fpm.sock; #legacy # fastcgi_pass 127.0.0.1:9000; fastcgi_split_path_info ^(.+\.php)(/.+)$;