Skip to content
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
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ resolver = "2"

[workspace.dependencies]
askama = "0.15"
chrono = "0.4"
comrak = "0.50"
cot = { version = "0.5", default-features = false }
cot-site-common = { path = "cot-site-common" }
Expand All @@ -33,6 +34,7 @@ nightly = ["cot-site-macros/nightly"]

[dependencies]
askama.workspace = true
chrono.workspace = true
cot = { workspace = true, features = ["live-reload"] }
cot-site-common.workspace = true
cot-site-macros.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion LICENSE-MIT
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
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.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
mod guides;
mod template_util;

use std::time::Duration;

Expand Down
5 changes: 5 additions & 0 deletions src/template_util.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
use chrono::Datelike;

pub(crate) fn current_year() -> i32 {
chrono::Utc::now().year()
}
2 changes: 1 addition & 1 deletion templates/_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ <h5 class="offcanvas-title" id="cot-offcanvas-navbar-label">Cot</h5>
<a href="/" class="d-block mb-3 link-body-emphasis text-decoration-none" title="Go to Cot homepage">
<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

</div>

<div class="col mb-3">
Expand Down