From 444aba30369f8186ba77f1e05c89ce46df99e0c0 Mon Sep 17 00:00:00 2001
From: sabine <6594573+sabine@users.noreply.github.com>
Date: Fri, 2 Aug 2024 09:24:35 +0200
Subject: [PATCH] improve events page title, cutoff date 90 days for events rss
feed (#2628)
---
src/ocamlorg_frontend/pages/events.eml | 4 ++--
tool/ood-gen/lib/planet.ml | 15 +++++++++++----
2 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/src/ocamlorg_frontend/pages/events.eml b/src/ocamlorg_frontend/pages/events.eml
index d6523bd80b..8427358a4a 100644
--- a/src/ocamlorg_frontend/pages/events.eml
+++ b/src/ocamlorg_frontend/pages/events.eml
@@ -1,7 +1,7 @@
let render ~recurring_events ~upcoming_events =
Community_layout.single_column_layout
-~title:"The Events"
-~description:"The Events page!"
+~title:"Upcoming OCaml Events"
+~description:"Discover OCaml Events all around the world!"
~canonical:Url.events
~current:Events @@
diff --git a/tool/ood-gen/lib/planet.ml b/tool/ood-gen/lib/planet.ml
index c0c33886f6..baaa656c46 100644
--- a/tool/ood-gen/lib/planet.ml
+++ b/tool/ood-gen/lib/planet.ml
@@ -281,11 +281,16 @@ module GlobalFeed = struct
(Syndic.Date.month start |> Syndic.Date.string_of_month)
(Syndic.Date.year start)
in
+ let cutoff =
+ Ptime.add_span start (Ptime.Span.v (90, 0L))
+ |> Option.get |> Ptime.to_rfc3339
+ in
let start = start |> Ptime.to_rfc3339 in
let events =
Event.all ()
|> List.filter (fun (e : Data_intf.Event.t) ->
- String.compare e.starts.yyyy_mm_dd start > 0)
+ String.compare e.starts.yyyy_mm_dd start > 0
+ && String.compare e.starts.yyyy_mm_dd cutoff < 0)
in
let authors = (Syndic.Atom.author "OCaml Events", []) in
let render_single_event (event : Data_intf.Event.t) =
@@ -303,7 +308,8 @@ module GlobalFeed = struct
(Syndic.Date.year start_date)
in
let content =
- Format.sprintf {|
%s // %s // %s|} event.url
+ Format.sprintf {|
%s // %s // %s
+|} event.url
event.title textual_location human_readable_date
in
content
@@ -313,7 +319,7 @@ module GlobalFeed = struct
events
|> List.map render_single_event
|> String.concat "\n"
- |> Format.sprintf {|
Upcoming OCaml events:
|}
+ |> Format.sprintf {|
|}
in
let period_start = Syndic.Date.of_rfc3339 start in
@@ -321,7 +327,8 @@ module GlobalFeed = struct
let id = Uri.of_string "https://ocaml.org/events" in
Syndic.Atom.entry ~id ~authors
~title:
- (Syndic.Atom.Text ("Upcoming OCaml Events: " ^ human_readable_date))
+ (Syndic.Atom.Text
+ ("Upcoming OCaml Events (" ^ human_readable_date ^ " and onwards)"))
~updated:period_start
~links:[ Syndic.Atom.link (Uri.of_string "https://ocaml.org/events") ]
~categories:[ Syndic.Atom.category "events" ]