Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: new site.debug variable #1833

Merged
merged 1 commit into from
Nov 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/3-Templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions src/Renderer/Site.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public function offsetExists($offset): bool
switch ($offset) {
case 'menus':
case 'home':
case 'debug':
return true;
}

Expand Down Expand Up @@ -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);
Expand Down