diff --git a/docs/3-Templates.md b/docs/3-Templates.md index 63b34c75f..53b26a31b 100644 --- a/docs/3-Templates.md +++ b/docs/3-Templates.md @@ -155,6 +155,7 @@ Can be displayed in a template with: | `site.allpages` | Collection of all pages, regardless of their language. | | `site.taxonomies` | Collection of vocabularies. | | `site.time` | [_Timestamp_](https://wikipedia.org/wiki/Unix_time) of the last generation. | +| `site.debug` | Debug mode: `true` or `false`. | #### site.menus diff --git a/src/Renderer/Site.php b/src/Renderer/Site.php index 959f6543e..aff7687e6 100644 --- a/src/Renderer/Site.php +++ b/src/Renderer/Site.php @@ -51,6 +51,7 @@ public function offsetExists($offset): bool switch ($offset) { case 'menus': case 'home': + case 'debug': return true; } @@ -83,6 +84,8 @@ public function offsetGet($offset) return new Language($this->config, $this->language); case 'home': return 'index'; + case 'debug': + return $this->builder->isDebug(); } return $this->config->get($offset, $this->language);