index, about: inject page object

This commit is contained in:
Reynir Björnsson 2023-02-16 10:55:52 +01:00
parent b9fe4a36ae
commit f3f0923337

View file

@ -51,6 +51,8 @@ module Index = struct
let inject (type a) (module D : Key_value.DESCRIBABLE with type t = a) t = let inject (type a) (module D : Key_value.DESCRIBABLE with type t = a) t =
D.[ "active", object_ $ [ "page", string "index" ] 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 ] ; "cooperative", object_ $ [ "body", string t.cooperative ]
; "what_we_do", object_ $ [ "body", string t.what_we_do ] ] ; "what_we_do", object_ $ [ "body", string t.what_we_do ] ]
@ (Metadata.Page.inject (module D) (Metadata.Page.make t.title t.description)) @ (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 } ; description= Metadata.Page.description page }
let inject (type a) (module D : Key_value.DESCRIBABLE with type t = a) t = 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)) @ (Metadata.Page.inject (module D) (Metadata.Page.make t.title t.description))
end end