From f3f09233372d521e9d94f02ed517320d3744d5a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reynir=20Bj=C3=B6rnsson?= Date: Thu, 16 Feb 2023 10:55:52 +0100 Subject: [PATCH] index, about: inject page object --- src/model.ml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/model.ml b/src/model.ml index 950517b..fb52ba6 100644 --- a/src/model.ml +++ b/src/model.ml @@ -51,6 +51,8 @@ module Index = struct let inject (type a) (module D : Key_value.DESCRIBABLE with type t = a) t = D.[ "active", object_ $ [ "page", string "index" ] + ; "page", object_ $ [ "title", string (Option.value ~default:"" t.title) + ; "description", string (Option.value ~default:"" t.description) ] ; "cooperative", object_ $ [ "body", string t.cooperative ] ; "what_we_do", object_ $ [ "body", string t.what_we_do ] ] @ (Metadata.Page.inject (module D) (Metadata.Page.make t.title t.description)) @@ -66,7 +68,9 @@ module About_us = struct ; description= Metadata.Page.description page } let inject (type a) (module D : Key_value.DESCRIBABLE with type t = a) t = - D.[ "active", object_ $ [ "page", string "about_us" ] ] + D.[ "active", object_ $ [ "page", string "about_us" ] + ; "page", object_ $ [ "title", string (Option.value ~default:"" t.title) + ; "description", string (Option.value ~default:"" t.description) ] ] @ (Metadata.Page.inject (module D) (Metadata.Page.make t.title t.description)) end