From 154e98c05ed109cec5c6061aa94a5b6017a25b38 Mon Sep 17 00:00:00 2001 From: Brian Glass Date: Thu, 30 Jul 2026 14:38:28 -0400 Subject: [PATCH] Link commemorations in the header to their full stories below the readings Each saint/feast in the top-of-page commemorations list now links to its corresponding story further down the page (in the section that follows the scripture readings), when one exists. Day.saint_links pairs each title with its DayCommemoration id (or None, for the story-less antiochian.org-harvested entries) in parallel with self.saints, which stays a plain string list since it's also consumed as such elsewhere (ical.py, RSS feed description). Story articles get a matching id="commemoration-{id}" anchor. Co-Authored-By: Claude Sonnet 5 --- calendarium/liturgics/day.py | 7 +++++++ calendarium/templates/readings.html | 6 +++--- orthocal/static/main.css | 7 +++++++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/calendarium/liturgics/day.py b/calendarium/liturgics/day.py index 1d6bb7f..bc84e58 100644 --- a/calendarium/liturgics/day.py +++ b/calendarium/liturgics/day.py @@ -294,6 +294,11 @@ async def _add_supplemental_commemorations(self): # self.feasts; story-only, excluded here. self.saints = [] + # Parallel to self.saints, but pairs each title with the story's id + # (or None) so the readings template can link a commemoration to its + # full story further down the page, without changing self.saints + # itself -- it's consumed as plain strings elsewhere (ical.py, RSS). + self.saint_links = [] self.spoken_saints = [] self.minimal_saints = [] for dcs in day_native_by_day.values(): @@ -304,11 +309,13 @@ async def _add_supplemental_commemorations(self): # feast-level-facts preference for this tradition. titles = [dc.title for dc in dcs] self.saints.extend(titles) + self.saint_links.extend((dc.title, dc.id if dc.story else None) for dc in dcs) self.spoken_saints.extend(dc.title for dc in dcs if _speech_worthy(dc)) if titles: self.minimal_saints.append('; '.join(titles)) self.saints.extend(dc.title for dc in additive) + self.saint_links.extend((dc.title, dc.id if dc.story else None) for dc in additive) self.spoken_saints.extend(dc.title for dc in additive if _speech_worthy(dc)) # spoken_saints excludes only the story-less tradition='greek' overlay diff --git a/calendarium/templates/readings.html b/calendarium/templates/readings.html index ec3f382..7cadd76 100644 --- a/calendarium/templates/readings.html +++ b/calendarium/templates/readings.html @@ -72,8 +72,8 @@

Feasts

Commemorations

    - {% for saint in day.saints %} -
  • {{ saint|widont }}
  • + {% for saint, story_id in day.saint_links %} +
  • {% if story_id %}{{ saint|widont }}{% else %}{{ saint|widont }}{% endif %}
  • {% endfor %}
@@ -107,7 +107,7 @@

Commemorations

{% for reading in day.stories %} -
+

{{ reading.title|widont }}

{{ reading.story|safe }} diff --git a/orthocal/static/main.css b/orthocal/static/main.css index 16f7027..c20741f 100644 --- a/orthocal/static/main.css +++ b/orthocal/static/main.css @@ -253,6 +253,13 @@ table.month tr:first-child th { color: black; padding: 0.5em; } +.commemorations li a { + color: inherit; + text-decoration: none; +} +.commemorations li a:hover { + text-decoration: underline; +} p.feast { font-weight: bold;