Skip to content

Commit

Permalink
prepare for merge
Browse files Browse the repository at this point in the history
  • Loading branch information
sabine committed Aug 1, 2024
1 parent f96dff4 commit b7642e9
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions tool/ood-gen/lib/event.ml
Original file line number Diff line number Diff line change
Expand Up @@ -84,26 +84,32 @@ let all () =

module EventsFeed = struct
let create_entry (log : t) =
let authors = (Syndic.Atom.author "Ocaml.org", []) in
let event_type = EventType.show log.event_type in
let textual_location = log.textual_location in
let start_date_str =
let authors = (Syndic.Atom.author "OCaml Events", []) in
let event_type = show_event_type log.event_type in
let textual_location = log.city ^ ", " ^ log.country in
let start_date_str =
log.starts.yyyy_mm_dd ^ "T"
^ Option.value ~default:"00:00" log.starts.utc_hh_mm
^ ":00Z"
let id = Uri.of_string (log.slug ^ " " ^ start_date_str) in
let location_summary =
match log.location with
| Some { lat; long } ->
Printf.sprintf "%s (lat: %f, long: %f)" textual_location lat long
| None -> textual_location
in
let start_date = Syndic.Date.of_rfc3339 start_date_str in
let human_readable_date =
Format.sprintf "%s %d, %d"
(Syndic.Date.month start_date |> Syndic.Date.string_of_month)
(Syndic.Date.day start_date)
(Syndic.Date.year start_date)
in
let content =
Format.sprintf {|%s takes place in %s starting %s.|} log.title
textual_location human_readable_date
in
let id = Uri.of_string (log.slug ^ " " ^ start_date_str) in
Syndic.Atom.entry ~id ~authors
~title:(Syndic.Atom.Text (log.title ^ " " ^ start_date_str))
~title:(Syndic.Atom.Text (log.title ^ " // " ^ human_readable_date))
~updated:start_date
~links:[ Syndic.Atom.link (Uri.of_string log.url) ]
~categories:[ Syndic.Atom.category event_type ]
~content:(Syndic.Atom.Text location_summary) ()
~content:(Syndic.Atom.Text content) ()

let create_feed () =
let open Rss in
Expand Down

0 comments on commit b7642e9

Please sign in to comment.