Skip to content

Commit 75be5ba

Browse files
kjaymillerclaude
andcommitted
Add current year to global site variables
- Move year variable from SponsoredEvents template_vars to global site_vars - Makes current year available to all templates - Enables year-based logic in foundational supporters display 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent b2c7643 commit 75be5ba

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
app.site_vars["locales"] = ["en"]
3232
app.site_vars["navigation"] = navigation
3333
app.site_vars["DATETIME_FORMAT"] = "%d %b %Y"
34+
app.site_vars["year"] = str(datetime.date.today().year)
3435

3536

3637
@app.page
@@ -58,7 +59,7 @@ class SponsoredEvents(Page):
5859
template = "sponsored-events.html"
5960
slug = "sponsored-events"
6061
data = json.loads(pathlib.Path("_data/sponsored_events.json").read_text())
61-
template_vars = {"year": str(datetime.date.today().year)}
62+
template_vars = {}
6263

6364

6465
@app.collection

0 commit comments

Comments
 (0)