mirror of
https://github.com/getgrav/grav.git
synced 2026-01-29 19:00:12 +01:00
set twig_first: false by default due to modular pages
This commit is contained in:
@@ -227,7 +227,7 @@ form:
|
||||
highlight: asc
|
||||
default: desc
|
||||
help: PLUGIN_ADMIN.TWIG_FIRST_HELP
|
||||
highlight: 1
|
||||
highlight: 0
|
||||
options:
|
||||
1: PLUGIN_ADMIN.YES
|
||||
0: PLUGIN_ADMIN.NO
|
||||
|
||||
@@ -31,7 +31,7 @@ pages:
|
||||
process:
|
||||
markdown: true # Process Markdown
|
||||
twig: false # Process Twig
|
||||
twig_first: true # Process Twig before markdown when processing both on a page
|
||||
twig_first: false # Process Twig before markdown when processing both on a page
|
||||
events:
|
||||
page: true # Enable page level events
|
||||
twig: true # Enable twig level events
|
||||
|
||||
@@ -484,9 +484,9 @@ class Page
|
||||
|
||||
$process_markdown = $this->shouldProcess('markdown');
|
||||
$process_twig = $this->shouldProcess('twig');
|
||||
$cache_enable = isset($this->header->cache_enable) ? $this->header->cache_enable : true;
|
||||
$cache_enable = isset($this->header->cache_enable) ? $this->header->cache_enable : $config->get('system.cache.enabled', true);
|
||||
$twig_first = isset($this->header->twig_first) ? $this->header->twig_first : $config->get('system.pages.twig_first', true);
|
||||
$twig_already_processed = false;
|
||||
|
||||
|
||||
// if no cached-content run everything
|
||||
if ($this->content === false || $cache_enable == false) {
|
||||
@@ -496,7 +496,6 @@ class Page
|
||||
if ($twig_first) {
|
||||
if ($process_twig) {
|
||||
$this->processTwig();
|
||||
$twig_already_processed = true;
|
||||
}
|
||||
if ($process_markdown) {
|
||||
$this->processMarkdown();
|
||||
@@ -518,7 +517,6 @@ class Page
|
||||
|
||||
if ($process_twig) {
|
||||
$this->processTwig();
|
||||
$twig_already_processed = true;
|
||||
}
|
||||
if ($cache_enable) {
|
||||
$this->cachePageContent();
|
||||
@@ -526,11 +524,6 @@ class Page
|
||||
}
|
||||
}
|
||||
|
||||
// only markdown content cached, process twig if required and not already processed
|
||||
if ($process_twig && !$cache_enable && !$twig_already_processed) {
|
||||
$this->processTwig();
|
||||
}
|
||||
|
||||
// Handle summary divider
|
||||
$delimiter = $config->get('site.summary.delimiter', '===');
|
||||
$divider_pos = mb_strpos($this->content, "<p>{$delimiter}</p>");
|
||||
|
||||
Reference in New Issue
Block a user