Conversation
{{ current_year() }}
There was a problem hiding this comment.
Pull request overview
This pull request updates copyright year references from hardcoded values to either 2026 (for LICENSE-MIT) or a dynamically generated current year (for the website footer template).
Changes:
- Updates the website footer copyright to dynamically display the current year using a new template utility function
- Creates a new
template_util.rsmodule with acurrent_year()function that returns the current year - Updates LICENSE-MIT copyright to 2024-2026
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| templates/_base.html | Updates footer copyright to use template_util::current_year() function instead of hardcoded "2025" |
| src/template_util.rs | Adds new module with current_year() function to get current year from chrono |
| LICENSE-MIT | Updates copyright year range from 2024-2025 to 2024-2026 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| MIT License | ||
|
|
||
| Copyright (c) 2024-2025 Mateusz Maćkowski and Cot contributors | ||
| Copyright (c) 2024-2026 Mateusz Maćkowski and Cot contributors |
There was a problem hiding this comment.
There's an inconsistency in approach: LICENSE-MIT uses a hardcoded year (2026) while the template footer uses a dynamic year function. Consider either:
- Making both static (simpler, but requires manual updates each year), or
- If you want LICENSE-MIT to be dynamic too, you'll need to generate it during the build process (more complex but automatic)
For most projects, keeping LICENSE files static is the standard approach, in which case you may want to reconsider whether the template footer needs to be dynamic.
| Copyright (c) 2024-2026 Mateusz Maćkowski and Cot contributors | |
| Copyright (c) 2024 Mateusz Maćkowski and Cot contributors |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <img src="{{ base_context.static_files.url_for("static/images/cot-dark.svg")? }}" alt="" width="80" height="64" class="mx-lg-auto d-block"> | ||
| </a> | ||
| <p class="text-body-secondary">© 2024-2025 Cot contributors</p> | ||
| <p class="text-body-secondary">© 2024-{{ template_util::current_year() }} Cot contributors</p> |
There was a problem hiding this comment.
The syntax template_util::current_year() is not supported by Askama without additional configuration. Askama does not allow calling arbitrary Rust functions from templates using module path syntax without registering them in an askama.toml configuration file.
To fix this, you have several options:
- Create an
askama.tomlfile in the project root with appropriate configuration to register the module path - Add the current year as a field in the template structs that extend
_base.html(e.g.,IndexTemplate,GuideTemplate, etc.) and pass it as a variable - Use a custom Askama filter instead of a direct function call
The most straightforward approach would be option 2: adding a current_year field to the templates.
| <p class="text-body-secondary">© 2024-{{ template_util::current_year() }} Cot contributors</p> | |
| <p class="text-body-secondary">© 2024-{{ current_year }} Cot contributors</p> |
There was a problem hiding this comment.
where is this hallucination even coming from
No description provided.