Pico::loadConfig(): Improve Twig config parsing
Thanks @refeaime for reporting this
This commit is contained in:
parent
d3c624777f
commit
13b167e23a
@ -465,7 +465,7 @@ class Pico
|
|||||||
'rewrite_url' => null,
|
'rewrite_url' => null,
|
||||||
'theme' => 'default',
|
'theme' => 'default',
|
||||||
'date_format' => '%D %T',
|
'date_format' => '%D %T',
|
||||||
'twig_config' => array('cache' => false, 'autoescape' => false, 'debug' => false),
|
'twig_config' => null,
|
||||||
'pages_order_by' => 'alpha',
|
'pages_order_by' => 'alpha',
|
||||||
'pages_order' => 'asc',
|
'pages_order' => 'asc',
|
||||||
'content_dir' => null,
|
'content_dir' => null,
|
||||||
@ -486,6 +486,13 @@ class Pico
|
|||||||
$this->config['rewrite_url'] = $this->isUrlRewritingEnabled();
|
$this->config['rewrite_url'] = $this->isUrlRewritingEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$defaultTwigConfig = array('cache' => false, 'autoescape' => false, 'debug' => false);
|
||||||
|
if (!is_array($this->config['twig_config'])) {
|
||||||
|
$this->config['twig_config'] = $defaultTwigConfig;
|
||||||
|
} else {
|
||||||
|
$this->config['twig_config'] += $defaultTwigConfig;
|
||||||
|
}
|
||||||
|
|
||||||
if (empty($this->config['content_dir'])) {
|
if (empty($this->config['content_dir'])) {
|
||||||
// try to guess the content directory
|
// try to guess the content directory
|
||||||
if (is_dir($this->getRootDir() . 'content')) {
|
if (is_dir($this->getRootDir() . 'content')) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user