Merge branch 'develop' of https://github.com/getgrav/grav into 1.5

This commit is contained in:
Matias Griese
2018-06-12 10:40:42 +03:00
7 changed files with 43 additions and 6 deletions

View File

@@ -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

View File

@@ -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)) {

View File

@@ -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;
}
/**

View File

@@ -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;
}
}

View File

@@ -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);
}

View File

@@ -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'

View File

@@ -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)(/.+)$;