Skip to content

chore: bump year to {{ current_year() }}#69

Open
m4tx wants to merge 4 commits intomasterfrom
update-year
Open

chore: bump year to {{ current_year() }}#69
m4tx wants to merge 4 commits intomasterfrom
update-year

Conversation

@m4tx
Copy link
Member

@m4tx m4tx commented Feb 3, 2026

No description provided.

@m4tx m4tx changed the title chore: bump year to {{ current_year() }} chore: bump year to {{ current_year() }} Feb 3, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.rs module with a current_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
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's an inconsistency in approach: LICENSE-MIT uses a hardcoded year (2026) while the template footer uses a dynamic year function. Consider either:

  1. Making both static (simpler, but requires manual updates each year), or
  2. 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.

Suggested change
Copyright (c) 2024-2026 Mateusz Maćkowski and Cot contributors
Copyright (c) 2024 Mateusz Maćkowski and Cot contributors

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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">&copy; 2024-2025 Cot contributors</p>
<p class="text-body-secondary">&copy; 2024-{{ template_util::current_year() }} Cot contributors</p>
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. Create an askama.toml file in the project root with appropriate configuration to register the module path
  2. 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
  3. 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.

Suggested change
<p class="text-body-secondary">&copy; 2024-{{ template_util::current_year() }} Cot contributors</p>
<p class="text-body-secondary">&copy; 2024-{{ current_year }} Cot contributors</p>

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where is this hallucination even coming from

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant