From e76f6291a1a81696088f3ddf8f5a191880ccba65 Mon Sep 17 00:00:00 2001 From: Thibaut Mattio Date: Wed, 31 May 2023 23:39:45 +0200 Subject: [PATCH] Add governance section Co-authored-by: Asaad Mahmood Co-authored-by: MirzaBabarBaig Co-authored-by: Cuihtlauac Alvarado --- asset/icons/discord.svg | 3 + asset/icons/email.svg | 3 + asset/icons/github-gray.svg | 3 + asset/icons/github.svg | 3 + asset/icons/slack.svg | 3 + data/governance.yml | 514 ++++++++++++++++++ src/global/url.ml | 4 +- src/ocamlorg_data/data.ml | 7 + src/ocamlorg_data/data.mli | 18 + src/ocamlorg_data/dune | 9 + .../css/partials/governance.css | 11 + src/ocamlorg_frontend/css/styles.css | 16 + src/ocamlorg_frontend/dune | 13 +- src/ocamlorg_frontend/ocamlorg_frontend.ml | 2 + src/ocamlorg_frontend/pages/governance.eml | 107 ++++ .../pages/governance_team.eml | 95 ++++ src/ocamlorg_web/lib/handler.ml | 12 +- src/ocamlorg_web/lib/redirection.ml | 1 - src/ocamlorg_web/lib/router.ml | 3 +- src/ocamlorg_web/lib/sitemap.ml | 1 + tool/ood-gen/bin/gen.ml | 1 + tool/ood-gen/lib/governance.ml | 65 +++ 22 files changed, 889 insertions(+), 5 deletions(-) create mode 100644 asset/icons/discord.svg create mode 100644 asset/icons/email.svg create mode 100644 asset/icons/github-gray.svg create mode 100644 asset/icons/github.svg create mode 100644 asset/icons/slack.svg create mode 100644 data/governance.yml create mode 100644 src/ocamlorg_frontend/css/partials/governance.css create mode 100644 src/ocamlorg_frontend/pages/governance.eml create mode 100644 src/ocamlorg_frontend/pages/governance_team.eml create mode 100644 tool/ood-gen/lib/governance.ml diff --git a/asset/icons/discord.svg b/asset/icons/discord.svg new file mode 100644 index 0000000000..38837b79d4 --- /dev/null +++ b/asset/icons/discord.svg @@ -0,0 +1,3 @@ + + + diff --git a/asset/icons/email.svg b/asset/icons/email.svg new file mode 100644 index 0000000000..450036d264 --- /dev/null +++ b/asset/icons/email.svg @@ -0,0 +1,3 @@ + + + diff --git a/asset/icons/github-gray.svg b/asset/icons/github-gray.svg new file mode 100644 index 0000000000..8a19e2a730 --- /dev/null +++ b/asset/icons/github-gray.svg @@ -0,0 +1,3 @@ + + + diff --git a/asset/icons/github.svg b/asset/icons/github.svg new file mode 100644 index 0000000000..eab79dabbf --- /dev/null +++ b/asset/icons/github.svg @@ -0,0 +1,3 @@ + + + diff --git a/asset/icons/slack.svg b/asset/icons/slack.svg new file mode 100644 index 0000000000..5ad4c8fcce --- /dev/null +++ b/asset/icons/slack.svg @@ -0,0 +1,3 @@ + + + diff --git a/data/governance.yml b/data/governance.yml new file mode 100644 index 0000000000..c891983a53 --- /dev/null +++ b/data/governance.yml @@ -0,0 +1,514 @@ +teams: +- id: compiler + name: Compiler + description: The OCaml Compiler team, responsible for the development and maintenance + of the language, the standard library and the compiler tools. + contacts: + - name: Email + link: https://inbox.ocaml.org/caml-list/ + icon: /icons/email.svg + - name: Discord + link: https://discord.com/channels/436568060288172042/904141760052228116 + icon: /icons/discord.svg + - name: GitHub + link: https://github.com/ocaml/ocaml/issues + icon: /icons/github.svg + members: + - name: Damien Doligez + github: damiendoligez + role: Team Lead + - name: Xavier Leroy + github: xavierleroy + role: Team Lead + - name: Alain Frisch + github: alainfrisch + role: Maintainer + - name: "Arma\xEBl Gu\xE9neau" + github: Armael + role: Maintainer + - name: David Allsopp + github: dra27 + role: Maintainer + - name: Enguerrand + github: Engil + role: Maintainer + - name: Florian Angeletti + github: Octachron + role: Maintainer + - name: "Fr\xE9d\xE9ric Bour" + github: let-def + role: Maintainer + - name: Gabriel Scherer + github: gasche + role: Maintainer + - name: Jacques Garrigue + github: garrigue + role: Maintainer + - name: Jacques-Henri Jourdan + github: jhjourdan + role: Maintainer + - name: Jeremy Yallop + github: yallop + role: Maintainer + - name: KC Sivaramakrishnan + github: kayceesrk + role: Maintainer + - name: Leo White + github: lpw25 + role: Maintainer + - name: Luc Maranget + github: maranget + role: Maintainer + - name: Mark Shinwell + github: mshinwell + role: Maintainer + - name: "Nicol\xE1s Ojeda B\xE4r" + github: nojb + role: Maintainer + - name: Pierre Chambart + github: chambart + role: Maintainer + - name: Sadiq Jaffer + github: sadiqj + role: Maintainer + - name: Stephen Dolan + github: stedolan + role: Maintainer + - name: "S\xE9bastien Hinderer" + github: shindere + role: Maintainer + - name: Thomas Refis + github: trefis + role: Maintainer + - name: Vincent Laviron + github: lthls + role: Maintainer +- id: infrastructure + name: Infrastructure + description: The infrastructure team is responsible to maintain and evolve the infrastructure + powering the official OCaml projects, including the servers for OCaml.org and + the opam-repository CI. + contacts: + - name: Email + link: infrastructure@lists.ocaml.org + icon: /icons/email.svg + - name: GitHub + link: https://github.com/ocaml/infrastructure/issues + icon: /icons/github.svg + members: + - name: Anil Madhavapeddy + github: avsm + role: Owner + - name: Tim McGilchrist + github: tmcgilchrist + role: Team Lead + - name: David Allsopp + github: dra27 + role: Maintainer + - name: Kate + github: kit-ty-kate + role: Maintainer + - name: Mark Elvers + github: mtelvers + role: Maintainer + - name: Navin Keswani + github: novemberkilo + role: Maintainer + - name: Puneeth Chaganti + github: punchagan + role: Maintainer + - name: Antonin Décimo + github: MisterDA + role: Maintainer + - name: Ben Andrew + github: benmandrew + role: Mainainter +- id: moderation + name: Moderation + description: The moderation team is responsible for the moderation of the official + OCaml forums and social platforms, such Discuss, Discord, or the mailing lists. + contacts: + - name: Email + link: moderation@lists.ocaml.org + icon: /icons/email.svg + members: + - name: Thomas Leonard + github: talex5 + role: Discuss Moderator + - name: Yotam Barnoy + github: Bluddy + role: Discord Moderator + - name: Gabriel Radanne + github: Drup + role: Discord Moderator + - name: Florian Angeletti + github: octachron + role: Discord Moderator +- id: packaging + name: Packaging + description: The Packaging team is responsible to ensure the quality of the OCaml + packages ecosystem, and in particular, to review submitions to the Opam repository. + contacts: + - name: Email + link: packaging@lists.ocaml.org + icon: /icons/email.svg + members: + - name: Anil Madhavapeddy + github: avsm + role: Team Lead + - name: Kate Deplaix + github: kit-ty-kate + role: Maintainer + - name: Marcello Seri + github: mseri + role: Maintainer +- id: platform + name: Platform + description: The Platform team is responsible for the development and maintenance + of the OCaml Platform, the official OCaml developer toolchain. + contacts: + - name: Email + link: platform@lists.ocaml.org + icon: /icons/email.svg + members: + - name: Anil Madhavapeddy + github: avsm + role: Owner + - name: Thibaut mattio + github: tmattio + role: Team Lead + subteams: + - id: opam-dev + name: Opam + description: The Opam development team + contacts: + - name: Email + link: opam-dev@lists.ocaml.org + icon: /icons/email.svg + members: + - name: Louis Gesbert + github: AltGr + role: Maintainer + - name: R. Boujbel + github: rjbou + role: Maintainer + - name: David Allsopp + github: dra27 + role: Maintainer + - name: Kate Deplaix + github: kit-ty-kate + role: Maintainer + - id: utop-dev + name: Utop + description: The Utop development team + contacts: + - name: Email + link: utop-dev@lists.ocaml.org + icon: /icons/email.svg + members: + - name: Etienne Millon + github: emillon + role: Team Lead + - name: Rudi Grinberg + github: rgrinberg + role: Maintainer + - id: opam-publish-dev + name: Opam-publish + description: The Opam-publish development team + contacts: + - name: Email + link: opam-publish-dev@lists.ocaml.org + icon: /icons/email.svg + members: + - name: Louis Gesbert + github: AltGr + role: Maintainer + - name: R. Boujbel + github: rjbou + role: Maintainer + - name: Kate + github: kit-ty-kate + role: Maintainer + - id: ocaml-lsp-dev + name: Ocaml-lsp + description: The Ocaml-lsp development team + contacts: + - name: Email + link: ocaml-lsp-dev@lists.ocaml.org + icon: /icons/email.svg + members: + - name: Rudi Grinberg + github: rgrinberg + role: Team Lead + - name: Corentin Leruth + github: tatchi + role: Maintainer + - name: Ulysse + github: voodoos + role: Maintainer + - name: Rafał Gwoździński + github: 3Rafal + role: Maintainer + - id: dune-dev + name: Dune + description: The Dune development team + contacts: + - name: Email + link: dune-dev@lists.ocaml.org + icon: /icons/email.svg + members: + - name: Rudi Grinberg + github: rgrinberg + role: Maintainer + - name: Ali Caglayan + github: Alizter + role: Maintainer + - name: Nicolás Ojeda Bär + github: nojb + role: Maintainer + - name: Marek Kubica + github: Leonidas-from-XIV + role: Maintainer + - name: Etienne Millon + github: emillon + role: Maintainer + - name: Stephen Sherratt + github: gridbugs + role: Maintainer + - name: Antonio Nuno Monteiro + github: anmonteiro + role: Maintainer + - name: Javier Chávarri + github: jchavarri + role: Maintainer + - name: Andrey Mokhov + github: snowleopard + role: Maintainer + - name: Emilio Jesús Gallego Arias + github: ejgallego + role: Maintainer + - name: Françoit Botot + github: bobot + role: Maintainer + - id: merlin-dev + name: Merlin + description: The merlin development team + contacts: + - name: Email + link: merlin-dev@lists.ocaml.org + icon: /icons/email.svg + members: + - name: Ulysse Gérard + github: voodoos + role: Team Lead + - name: Sonja Heinze + github: pitag-ha + role: Maintainer + - name: "Fr\xE9d\xE9ric Bour" + github: let-def + role: Maintainer + - name: Thomas Refis + github: trefis + role: Maintainer + - id: odoc-dev + name: Odoc + description: The odoc development team + contacts: + - name: Email + link: odoc-dev@lists.ocaml.org + icon: /icons/email.svg + members: + - name: Jon Ludlam + github: jonludlam + role: Team Lead + - name: "Daniel B\xFCnzli" + github: dbuenzli + role: Maintainer + - name: Leo White + github: lpw25 + role: Maintainer + - name: Thomas Refis + github: trefis + role: Maintainer + - name: Jules Aguillon + github: Julow + role: Maintainer + - name: Paul-Elliot Anglès D'Auriac + github: panglesd + role: Maintainer + - name: Emile Trotignon + github: EmileTrotignon + role: Maintainer + - name: Guillaume Petiot + github: gpetiot + role: Maintainer + - id: ppxlib-dev + name: Ppxlib + description: The ppxlib development team + contacts: + - name: Email + link: ppxlib-dev@lists.ocaml.org + icon: /icons/email.svg + members: + - name: Sonja Heinze + github: pitag-ha + role: Team Lead + - name: Carl Eastlund + github: ceastlund + role: ppxlib maintainer + - name: "Paul-Elliot Angl\xE8s d'Auriac" + github: panglesd + role: ppxlib maintainer + - id: ocamlformat-dev + name: Ocamlformat + description: The Ocamlformat development team + contacts: + - name: Email + link: ocamlformat-dev@lists.ocaml.org + icon: /icons/email.svg + members: + - name: Guillaume Petiot + github: gpetiot + role: Team Lead + - name: Jules Aguillon + github: Julow + role: Maintainer + - name: Emile Trotignon + github: EmileTrotignon + role: Maintainer + - id: dune-release-dev + name: Dune-release + description: The Dune-release development team + contacts: + - name: Email + link: dune-release-dev@lists.ocaml.org + icon: /icons/email.svg + members: + - name: Etienne Millon + github: emillon + role: Maintainer + - name: Marek Kubica + github: Leonidas-from-XIV + role: Maintainer + - id: mdx-dev + name: Mdx + description: The Mdx development team + contacts: + - name: Email + link: mdx-dev@lists.ocaml.org + icon: /icons/email.svg + members: + - name: Marek Kubica + github: Leonidas-from-XIV + role: Team Lead + - id: ocp-indent-dev + name: Ocp-indent + description: The Ocp-indent development team + contacts: + - name: Email + link: ocp-indent-dev@lists.ocaml.org + icon: /icons/email.svg + members: + - name: Louis Gesbert + github: AltGr + role: Team Lead + - id: ocamlfind-dev + name: Ocamlfind + description: The Ocamlfind development team + contacts: + - name: Email + link: ocamlfind-dev@lists.ocaml.org + icon: /icons/email.svg + members: + - name: Gerd Stolpmann + github: gerdstolpmann + role: Team Lead + - name: David Allsopp + github: dra27 + role: Maintainer + - id: omp-dev + name: Omp + description: The Omp development team + contacts: + - name: Email + link: omp-dev@lists.ocaml.org + icon: /icons/email.svg + members: + - name: Sonja Heinze + github: pitag-ha + role: Team Lead +- id: web + name: Web + description: The Web team is responsible for the development and maintenance of + the official OCaml websites, in particular OCaml.org and its subdomains. + contacts: + - name: Email + link: web@lists.ocaml.org + icon: /icons/email.svg + members: + - name: Anil Madhavapeddy + github: avsm + role: Owner + - name: Thibaut Mattio + github: tmattio + role: Team Lead + - name: Sabine Schmaltz + github: sabine + role: Maintainer + - name: Cuihtlauac Alvarado + github: cuihtlauac + role: Maintainer + - name: Claire Vandenberghe + github: Clairevanden + role: Designer + - name: Christine Rose + github: christinerose + role: Technical Writer +working-groups: +- id: wg-multicore + name: Multicore Working Group + description: Work on tools and libraries to do multicore programming with OCaml. + contacts: + - name: Email + link: wg-multicore@lists.ocaml.org + icon: /icons/email.svg + members: + - name: Vesa Karvonen + github: polytypic + role: Maintainer + - name: KC Sivaramakrishnan + github: kayceesrk + role: Maintainer + - name: Thomas Leonard + github: talex5 + role: Maintainer + - name: Vincent Balat + github: balat + role: Maintainer + - name: Sudha Parimala + github: Sudha247 + role: Maintainer + - name: Anil Madhavapeddy + github: avsm + role: Maintainer + - name: Gibb + github: Ryan + role: Maintainer + - name: Patrick Ferris + github: patricoferris + role: Maintainer + - name: Christiano Haesbaert + github: haesbaert + role: Maintainer + - name: Lucas Pluvinage + github: TheLortex + role: Maintainer + - name: Sadiq Jaffer + github: sadiqj + role: Maintainer + - name: Jan Midtgaard + github: jmid + role: Maintainer + - name: Carine Morel + github: lyrm + role: Maintainer diff --git a/src/global/url.ml b/src/global/url.ml index 462869a5c3..dda4a03b13 100644 --- a/src/global/url.ml +++ b/src/global/url.ml @@ -58,9 +58,11 @@ let blog_post v = "/blog/" ^ v let news = "/news" let news_post v = "/news/" ^ v let jobs = "/jobs" +let governance = "/governance" +let governance_team id = "/governance/" ^ id let carbon_footprint = "/policies/carbon-footprint" let privacy_policy = "/policies/privacy-policy" -let governance = "/policies/governance" +let governance_policy = "/policies/governance" let code_of_conduct = "/policies/code-of-conduct" let playground = "/play" let papers = "/papers" diff --git a/src/ocamlorg_data/data.ml b/src/ocamlorg_data/data.ml index 5bf352baef..d29e36c1ff 100644 --- a/src/ocamlorg_data/data.ml +++ b/src/ocamlorg_data/data.ml @@ -165,3 +165,10 @@ module Code_example = struct let get title = List.find (fun x -> String.equal x.title title) all end + +module Governance = struct + include Governance + + let get_by_id id = + List.find_opt (fun x -> String.equal id x.id) (teams @ working_groups) +end diff --git a/src/ocamlorg_data/data.mli b/src/ocamlorg_data/data.mli index 96f656ad52..aae1ee7cb3 100644 --- a/src/ocamlorg_data/data.mli +++ b/src/ocamlorg_data/data.mli @@ -396,3 +396,21 @@ module Code_example : sig val get : string -> t end + +module Governance : sig + type member = { name : string; github : string; role : string } + type contact = { name : string; link : string; icon : string } + + type team = { + id : string; + name : string; + description : string; + contacts : contact list; + members : member list; + subteams : team list; + } + + val teams : team list + val working_groups : team list + val get_by_id : string -> team option +end diff --git a/src/ocamlorg_data/dune b/src/ocamlorg_data/dune index 9d6742dc1d..ea3382e257 100644 --- a/src/ocamlorg_data/dune +++ b/src/ocamlorg_data/dune @@ -17,6 +17,15 @@ (run %{dep:../../tool/ood-gen/bin/gen.exe} book)))) (rule + (deps ../../tool/ood-gen/bin/gen.exe) + (target governance.ml) + (action + (with-stdout-to + %{target} + (run %{dep:../../tool/ood-gen/bin/gen.exe} governance)))) + +(rule + (deps ../../tool/ood-gen/bin/gen.exe) (target changelog.ml) (action (with-stdout-to diff --git a/src/ocamlorg_frontend/css/partials/governance.css b/src/ocamlorg_frontend/css/partials/governance.css new file mode 100644 index 0000000000..f92abedc85 --- /dev/null +++ b/src/ocamlorg_frontend/css/partials/governance.css @@ -0,0 +1,11 @@ +.governance-card { + @apply flex-col; +} + +.governance-card__title { + @apply text-2xl mb-5 font-semibold flex items-center; +} + +.governance-card__svg { + @apply h-8 w-8 ml-2; +} diff --git a/src/ocamlorg_frontend/css/styles.css b/src/ocamlorg_frontend/css/styles.css index 5c4454e8fa..7653a63814 100644 --- a/src/ocamlorg_frontend/css/styles.css +++ b/src/ocamlorg_frontend/css/styles.css @@ -12,6 +12,8 @@ @import "./partials/shadows.css"; @import "./partials/tags.css"; @import "./partials/typography.css"; +@import "./partials/governance.css"; + @import "./other/syntax.css"; @@ -51,6 +53,12 @@ body { -webkit-text-fill-color: transparent; } +h2.gradient { + background: -webkit-linear-gradient(left, #EFA4F2,#0076ff, #62A8FF); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; +} + .swiper { max-width: 100vw; } @@ -234,6 +242,14 @@ summary::marker { .output-container { height: calc(100% - 60px); } +.our-team { + background: linear-gradient(270deg, #0B1528 0%, rgba(11, 21, 40, 0.958333) 53.65%, #0B1528 100%); +} +.our-team button { + border: 1px solid #fff; + color: #fff; + opacity: 0.6; +} /* summary & details expandable section */ diff --git a/src/ocamlorg_frontend/dune b/src/ocamlorg_frontend/dune index ab0e147ee3..28e1a93d26 100644 --- a/src/ocamlorg_frontend/dune +++ b/src/ocamlorg_frontend/dune @@ -162,7 +162,18 @@ (action (run %{bin:dream_eml} %{dep:release.eml} --workspace %{workspace_root}))) (rule - (target releases.ml) + (targets governance.ml) + (deps governance.eml) + (action + (run %{bin:dream_eml} %{deps} --workspace %{workspace_root}))) + (rule + (targets governance_team.ml) + (deps governance_team.eml) + (action + (run %{bin:dream_eml} %{deps} --workspace %{workspace_root}))) + (rule + (targets releases.ml) + (deps releases.eml) (action (run %{bin:dream_eml} %{dep:releases.eml} --workspace %{workspace_root}))) (rule diff --git a/src/ocamlorg_frontend/ocamlorg_frontend.ml b/src/ocamlorg_frontend/ocamlorg_frontend.ml index 91dfc8b48e..711dfda4fc 100644 --- a/src/ocamlorg_frontend/ocamlorg_frontend.ml +++ b/src/ocamlorg_frontend/ocamlorg_frontend.ml @@ -37,3 +37,5 @@ let success_story = Success_story.render let tutorial = Tutorial.render let workshop = Workshop.render let outreachy = Outreachy.render +let governance ~teams = Governance.render ~teams +let governance_team team = Governance_team.render team diff --git a/src/ocamlorg_frontend/pages/governance.eml b/src/ocamlorg_frontend/pages/governance.eml new file mode 100644 index 0000000000..0b2326ffe5 --- /dev/null +++ b/src/ocamlorg_frontend/pages/governance.eml @@ -0,0 +1,107 @@ +let render ~teams ~working_groups = +Layout.render +~title:"Governance" +~description:"OCaml is a mature, statically-typed, functional programming language. Learn more about its rich history +and what makes it unique." @@ +
+
+
+
+
+

Governance

+
The projects running under OCaml and the awesome teams + behind it +
+ +
+
+
+
+
+ +
+
+
+

Our Teams

+
+ Odio amet cursus eu cursus nunc bibendum mauris. Nunc tempor fermentum phasellus mi nulla id fermentum + integer + id. Nec quisque consequat et, risus ultrices orci ut massa. +
+
+ <% teams |> List.iter (fun (team : Data.Governance.team) -> %> +
+
+ <%s team.name %> + + + +
+
<%s team.description %>
+
<%i List.length (List.concat (List.map (fun (team : Data.Governance.team) -> team.members) team.subteams)) %> team members
+ + See members + + + + +
+ <% );%> +
+
+
+
+ + + + + + + + + + + + + + +
+
+
+

Working groups

+
+ Odio amet cursus eu cursus nunc bibendum mauris. Nunc tempor fermentum phasellus mi nulla id fermentum + integer + id. Nec quisque consequat et, risus ultrices orci ut massa.
+
+ <% working_groups |> List.iter (fun (wg : Data.Governance.team) -> %> +
+
+ <%s wg.name %> + + + +
+
<%s wg.description %>
+
<%i List.length (List.concat (List.map (fun (team : Data.Governance.team) -> team.members) wg.subteams)) %> members
+ + See members + + + + +
+ <% ); %> +
+
+
+
\ No newline at end of file diff --git a/src/ocamlorg_frontend/pages/governance_team.eml b/src/ocamlorg_frontend/pages/governance_team.eml new file mode 100644 index 0000000000..47311d4823 --- /dev/null +++ b/src/ocamlorg_frontend/pages/governance_team.eml @@ -0,0 +1,95 @@ +let render (t : Data.Governance.team) = +Layout.render +~title:(Printf.sprintf "%s · OCaml Governance" t.name) +~description:t.description @@ +
+
+
+
+
+
+ + + + + Back to Governance +
+

<%s t.name %> Governance

+
+ <%s t.description%> +
+
+ <% t.contacts |> List.iter (fun (contact : Data.Governance.contact) -> %> + + + + <% ); %> +
+
+
+
+
+
+
+
+
+

Team Members

+
+ Odio amet cursus eu cursus nunc bibendum mauris. Nunc tempor fermentum phasellus mi nulla id fermentum + integer + id. Nec quisque consequat et, risus ultrices orci ut massa. +
+ <% t.subteams |> List.iter (fun (team : Data.Governance.team) -> %> + <% (match List.length t.subteams with | 1 -> () | _ -> %> +

<%s team.name %>

+ <% ); %> +
+ <% team.members |> List.iter (fun (member : Data.Governance.member) -> %> +
+ +
+
<%s member.name %>
+
<%s member.role %>
+
+ + <%s member.github %> +
+
+
+ <% ); %> +
+ <% ); %> +
+
+
+ + + + + + + + + + + + + + + + + + + + diff --git a/src/ocamlorg_web/lib/handler.ml b/src/ocamlorg_web/lib/handler.ml index f22f49e2d7..736dc1354d 100644 --- a/src/ocamlorg_web/lib/handler.ml +++ b/src/ocamlorg_web/lib/handler.ml @@ -226,7 +226,7 @@ let page canonical (_req : Dream.request) = let carbon_footprint = page Url.carbon_footprint let privacy_policy = page Url.privacy_policy -let governance = page Url.governance +let governance_policy = page Url.governance_policy let code_of_conduct = page Url.code_of_conduct let playground _req = @@ -234,6 +234,16 @@ let playground _req = let default_code = default.body in Dream.html (Ocamlorg_frontend.playground ~default_code) +let governance _req = + Dream.html + (Ocamlorg_frontend.governance ~teams:Data.Governance.teams + ~working_groups:Data.Governance.working_groups) + +let governance_team req = + let id = Dream.param req "id" in + let? team = Data.Governance.get_by_id id in + Dream.html (Ocamlorg_frontend.governance_team team) + let papers req = let search_paper pattern t = let open Data.Paper in diff --git a/src/ocamlorg_web/lib/redirection.ml b/src/ocamlorg_web/lib/redirection.ml index b816de1270..fd105fcca4 100644 --- a/src/ocamlorg_web/lib/redirection.ml +++ b/src/ocamlorg_web/lib/redirection.ml @@ -687,7 +687,6 @@ let t = make ~permanent:true [ ("/carbon-footprint", "/policies/carbon-footprint") ]; make ~permanent:true [ ("/privacy-policy", "/policies/privacy-policy") ]; - make ~permanent:true [ ("/governance", "/policies/governance") ]; make ~permanent:true [ ("/code-of-conduct", "/policies/code-of-conduct") ]; make ~permanent:true [ ("/opportunities", "/jobs") ]; make ~permanent:false [ (Url.workshops, Url.community ^ "#workshops") ]; diff --git a/src/ocamlorg_web/lib/router.ml b/src/ocamlorg_web/lib/router.ml index c719d3bae8..8bcf1d16c6 100644 --- a/src/ocamlorg_web/lib/router.ml +++ b/src/ocamlorg_web/lib/router.ml @@ -46,7 +46,8 @@ let page_routes = Dream.get Url.carbon_footprint Handler.carbon_footprint; Dream.get Url.privacy_policy Handler.privacy_policy; Dream.get Url.governance Handler.governance; - Dream.get Url.code_of_conduct Handler.code_of_conduct; + Dream.get (Url.governance_team ":id") Handler.governance_team; + Dream.get Url.governance_policy Handler.governance_policy; Dream.get Url.papers Handler.papers; Dream.get Url.best_practices Handler.best_practices; Dream.get Url.problems Handler.problems; diff --git a/src/ocamlorg_web/lib/sitemap.ml b/src/ocamlorg_web/lib/sitemap.ml index 4fbf2bec43..ebaf2dfa17 100644 --- a/src/ocamlorg_web/lib/sitemap.ml +++ b/src/ocamlorg_web/lib/sitemap.ml @@ -19,6 +19,7 @@ let urls = Url.jobs; Url.carbon_footprint; Url.privacy_policy; + Url.governance_policy; Url.governance; Url.code_of_conduct; Url.playground; diff --git a/tool/ood-gen/bin/gen.ml b/tool/ood-gen/bin/gen.ml index 685269f4c5..9180d70898 100644 --- a/tool/ood-gen/bin/gen.ml +++ b/tool/ood-gen/bin/gen.ml @@ -4,6 +4,7 @@ let term_templates = [ ("academic_institution", Ood_gen.Academic_institution.template); ("book", Ood_gen.Book.template); + ("governance", Ood_gen.Governance.template); ("job", Ood_gen.Job.template); ("meetup", Ood_gen.Meetup.template); ("news", Ood_gen.News.template); diff --git a/tool/ood-gen/lib/governance.ml b/tool/ood-gen/lib/governance.ml new file mode 100644 index 0000000000..7726ed2bdf --- /dev/null +++ b/tool/ood-gen/lib/governance.ml @@ -0,0 +1,65 @@ +open Ocamlorg.Import + +type member = { name : string; github : string; role : string } +[@@deriving yaml, show { with_path = false }] + +type contact = { name : string; link : string; icon : string } +[@@deriving yaml, show { with_path = false }] + +type team = { + id : string; + name : string; + description : string; + contacts : contact list; + members : member list; [@default []] + subteams : team list; [@default []] +} +[@@deriving yaml, show { with_path = false }] + +type metadata = { + teams : team list; + working_groups : team list; [@key "working-groups"] +} +[@@deriving yaml] + +type t = { teams : team list; working_groups : team list } +[@@deriving stable_record ~version:metadata, show { with_path = false }] + +let decode s = Result.map of_metadata (metadata_of_yaml s) + +let all () = + let file = "governance.yml" in + let result = + let ( let* ) = Result.bind in + let* yaml = Utils.yaml_file file in + decode yaml + in + result + |> Result.map_error (function `Msg err -> `Msg (file ^ ": " ^ err)) + |> Result.get_ok ~error:(fun (`Msg msg) -> Exn.Decode_error msg) + +let template () = + let t = all () in + Format.asprintf + {| +type member = { name : string; github : string; role : string } + +type contact = { name : string; link : string; icon : string } + +type team = { + id : string; + name : string; + description : string; + contacts : contact list; + members : member list; + subteams : team list; +} + +let teams = %a + +let working_groups = %a +|} + (Fmt.brackets (Fmt.list pp_team ~sep:Fmt.semi)) + t.teams + (Fmt.brackets (Fmt.list pp_team ~sep:Fmt.semi)) + t.working_groups