aboutsummaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authorValentin <valentin@fricklerhandwerk.de>2026-10-26 13:46:57 +0100
committerValentin <valentin@fricklerhandwerk.de>2026-10-26 13:46:57 +0100
commit7c28154d13bbbb57ad187ca2fe9b6110dcc3d3a9 (patch)
tree5cd3467b0d19bdade4b7e7d78ebbffad0e57dca7 /www
parent230fb67430ce5860ad22ecd622cafe5e48b66365 (diff)
Termine maschinenlesbar gemachtmain
Diffstat (limited to 'www')
-rw-r--r--www/framework/event.nix15
-rw-r--r--www/termine.nix12
2 files changed, 15 insertions, 12 deletions
diff --git a/www/framework/event.nix b/www/framework/event.nix
index f0489db..1704263 100644
--- a/www/framework/event.nix
+++ b/www/framework/event.nix
@@ -179,13 +179,16 @@
default =
let
date = lib.concatStringsSep "." (lib.reverseList (lib.splitString "-" cfg.date.start));
- time =
- if cfg.time.end == null then
- "ab ${cfg.time.start}"
- else
- "von ${cfg.time.start} bis ${cfg.time.end}";
+ start = text: ''<time itemprop="startDate" datetime="${cfg.date.start}T${cfg.time.start}">${text}</time>'';
+ end = ''<time itemprop="endDate" datetime="${cfg.date.start}T${cfg.time.end}">${cfg.time.end}</time>'';
in
- "${weekday cfg.date.start}, ${date} ${time}";
+ "${weekday cfg.date.start}, "
+ + (
+ if cfg.time.end == null then
+ start "${date} ab ${cfg.time.start}"
+ else
+ "${start "${date} von ${cfg.time.start}"} bis ${end}"
+ );
defaultText = lib.literalMD "Wochentag, Datum und Uhrzeit aus den Zeitangaben des Termins";
};
venue = mkOption {
diff --git a/www/termine.nix b/www/termine.nix
index 212bf1a..45727a5 100644
--- a/www/termine.nix
+++ b/www/termine.nix
@@ -27,19 +27,19 @@
type = functionTo str;
readOnly = true;
default = self: ''
- <dt class="event-title" id="${self.name}"><a href="#${self.name}">${self.title}</a></dt>
- <dd class="event-body">
- <time datetime="${self.date.start} ${self.time.start}">${self.datetime-range-text}</time>
+ <dt class="event-title" id="${self.name}" itemprop="name"><a href="#${self.name}">${self.title}</a></dt>
+ <dd class="event-body" itemscope itemtype="https://schema.org/Event" itemref="${self.name}">
+ ${self.datetime-range-text}
- <address>
- ${self.address.name}<br>
+ <address itemprop="location" itemscope itemtype="https://schema.org/Place">
+ <span itemprop="name">${self.address.name}</span><br>
<a target="_blank" href="${
let
type = with lib; head (attrNames self.address.openstreetmap);
id = self.address.openstreetmap.${type};
in
"https://www.openstreetmap.org/${type}/${toString id}"
- }">${with lib; concatStringsSep ", " (splitString "\n" (trim self.address.text))}</a>
+ }"><span itemprop="address">${with lib; concatStringsSep ", " (splitString "\n" (trim self.address.text))}</span></a>
</address>
${