diff --git a/data/changelog/dune/2023-02-20-exec-watch-mode.md b/data/changelog/dune/2023-02-20-dune-3.7.0-exec-watch-mode.md similarity index 97% rename from data/changelog/dune/2023-02-20-exec-watch-mode.md rename to data/changelog/dune/2023-02-20-dune-3.7.0-exec-watch-mode.md index cd7a7a766e..f7ecb05ace 100644 --- a/data/changelog/dune/2023-02-20-exec-watch-mode.md +++ b/data/changelog/dune/2023-02-20-dune-3.7.0-exec-watch-mode.md @@ -1,6 +1,6 @@ --- title: Watch mode for executables -date: "2023-02-20-02" +date: "2023-02-20" tags: [dune, platform, feature] --- diff --git a/data/changelog/dune/2023-02-20-native-windows-polling.md b/data/changelog/dune/2023-02-20-dune-3.7.0-native-windows-polling.md similarity index 95% rename from data/changelog/dune/2023-02-20-native-windows-polling.md rename to data/changelog/dune/2023-02-20-dune-3.7.0-native-windows-polling.md index 0cc4fa1409..3b4d4dd2b7 100644 --- a/data/changelog/dune/2023-02-20-native-windows-polling.md +++ b/data/changelog/dune/2023-02-20-dune-3.7.0-native-windows-polling.md @@ -1,6 +1,6 @@ --- title: Native polling mode for Windows -date: "2023-02-20-03" +date: "2023-02-20" tags: [dune, platform, feature] --- diff --git a/data/changelog/dune/2023-02-20-qualified-subdirs.md b/data/changelog/dune/2023-02-20-dune-3.7.0-qualified-subdirs.md similarity index 100% rename from data/changelog/dune/2023-02-20-qualified-subdirs.md rename to data/changelog/dune/2023-02-20-dune-3.7.0-qualified-subdirs.md diff --git a/data/changelog/dune/2023-05-31-dune-concurrent-action.md b/data/changelog/dune/2023-05-31-dune-3.8.0-dune-concurrent-action.md similarity index 95% rename from data/changelog/dune/2023-05-31-dune-concurrent-action.md rename to data/changelog/dune/2023-05-31-dune-3.8.0-dune-concurrent-action.md index 23453d8eb1..e0403ad827 100644 --- a/data/changelog/dune/2023-05-31-dune-concurrent-action.md +++ b/data/changelog/dune/2023-05-31-dune-3.8.0-dune-concurrent-action.md @@ -1,6 +1,6 @@ --- title: Dune `concurrent` action -date: "2023-05-31-01" +date: "2023-05-31" tags: [dune, platform, feature] --- diff --git a/data/changelog/dune/2023-05-31-dune-support-mld.md b/data/changelog/dune/2023-05-31-dune-3.8.0-dune-support-mld.md similarity index 95% rename from data/changelog/dune/2023-05-31-dune-support-mld.md rename to data/changelog/dune/2023-05-31-dune-3.8.0-dune-support-mld.md index 2b805aa8d4..72f5222f40 100644 --- a/data/changelog/dune/2023-05-31-dune-support-mld.md +++ b/data/changelog/dune/2023-05-31-dune-3.8.0-dune-support-mld.md @@ -1,6 +1,6 @@ --- title: Run code blocks in your `.mld` files -date: "2023-05-31-02" +date: "2023-05-31" tags: [dune, platform, feature] --- diff --git a/data/changelog/infra/2023-06-28-upgrading-linux-distros.md b/data/changelog/infra/2023-06-28-upgrading-linux-distros.md index 59ad900930..854df47235 100644 --- a/data/changelog/infra/2023-06-28-upgrading-linux-distros.md +++ b/data/changelog/infra/2023-06-28-upgrading-linux-distros.md @@ -1,7 +1,7 @@ --- title: OCaml infra upgrading to Debian 12 for OCaml docker images date: "2023-06-28" -tags: [ocaml-dockerfile, docker-base-images, ocaml-ci, opam-repo-ci, infra] +tags: [infra] changelog: | * OCaml Debian images upgraded to Debian 12 ([ocaml-dockerfile#172](https://github.com/ocurrent/ocaml-dockerfile/pull/172/files), @MisterDA) * Deprecation of Ubuntu 18.04, Alpine 3.16 and 3.17, OracleLinux 7, OpenSUSE 15.2 images ([ocaml-dockerfile#176](https://github.com/ocurrent/ocaml-dockerfile/pull/176/files), @avsm) diff --git a/data/changelog/mdx/2023-04-17-run-code-in-mld.md b/data/changelog/mdx/2023-04-17-mdx-2.3.0-run-code-in-mld.md similarity index 98% rename from data/changelog/mdx/2023-04-17-run-code-in-mld.md rename to data/changelog/mdx/2023-04-17-mdx-2.3.0-run-code-in-mld.md index 8ecdb494fe..ffbd29493b 100644 --- a/data/changelog/mdx/2023-04-17-run-code-in-mld.md +++ b/data/changelog/mdx/2023-04-17-mdx-2.3.0-run-code-in-mld.md @@ -1,6 +1,6 @@ --- title: Execute Code Blocks in Mld Files -date: "2023-04-17-01" +date: "2023-04-17" tags: [mdx, platform, feature] --- diff --git a/data/changelog/ocamlformat/2023-03-06-new-options.md b/data/changelog/ocamlformat/2023-03-06-ocamlformat-0.25.1-new-options.md similarity index 98% rename from data/changelog/ocamlformat/2023-03-06-new-options.md rename to data/changelog/ocamlformat/2023-03-06-ocamlformat-0.25.1-new-options.md index 17a0a6b89a..6a6a226312 100644 --- a/data/changelog/ocamlformat/2023-03-06-new-options.md +++ b/data/changelog/ocamlformat/2023-03-06-ocamlformat-0.25.1-new-options.md @@ -1,6 +1,6 @@ --- title: New Formatting Options in OCamlFormat -date: "2023-03-06-01" +date: "2023-03-06" tags: [ocamlformat, platform, feature] --- diff --git a/src/global/url.ml b/src/global/url.ml index 462869a5c3..d7967d58d6 100644 --- a/src/global/url.ml +++ b/src/global/url.ml @@ -49,6 +49,7 @@ let api_with_version v = v2 ^ "/releases/" ^ minor v ^ "/api/index.html" let api = "/releases/latest/api/index.html" let books = "/books" let changelog = "/changelog" +let changelog_entry id = "/changelog/" ^ id let releases = "/releases" let release v = "/releases/" ^ v let workshops = "/workshops" diff --git a/src/ocamlorg_data/data.ml b/src/ocamlorg_data/data.ml index 5bf352baef..a9fa1fbfcf 100644 --- a/src/ocamlorg_data/data.ml +++ b/src/ocamlorg_data/data.ml @@ -13,6 +13,8 @@ end module Changelog = struct include Changelog + + let get_by_slug slug = List.find_opt (fun x -> String.equal slug x.slug) all end module Job = struct diff --git a/src/ocamlorg_data/data.mli b/src/ocamlorg_data/data.mli index a194ce6e61..e8cf9374c5 100644 --- a/src/ocamlorg_data/data.mli +++ b/src/ocamlorg_data/data.mli @@ -59,6 +59,7 @@ module Changelog : sig } val all : t list + val get_by_slug : string -> t option end module Job : sig diff --git a/src/ocamlorg_frontend/dune b/src/ocamlorg_frontend/dune index ab0e147ee3..7916f8340b 100644 --- a/src/ocamlorg_frontend/dune +++ b/src/ocamlorg_frontend/dune @@ -61,6 +61,10 @@ (target changelog.ml) (action (run %{bin:dream_eml} %{dep:changelog.eml} --workspace %{workspace_root}))) + (rule + (target changelog_entry.ml) + (action + (run %{bin:dream_eml} %{dep:changelog_entry.eml} --workspace %{workspace_root}))) (rule (target news.ml) (action diff --git a/src/ocamlorg_frontend/ocamlorg_frontend.ml b/src/ocamlorg_frontend/ocamlorg_frontend.ml index 91dfc8b48e..00a40e3bb6 100644 --- a/src/ocamlorg_frontend/ocamlorg_frontend.ml +++ b/src/ocamlorg_frontend/ocamlorg_frontend.ml @@ -10,6 +10,7 @@ let best_practices = Best_practices.render let blog = Blog.render let blog_post = Blog_post.render let changelog = Changelog.render +let changelog_entry = Changelog_entry.render let books = Books.render let community = Community.render let home = Home.render diff --git a/src/ocamlorg_frontend/pages/changelog.eml b/src/ocamlorg_frontend/pages/changelog.eml index 28cd9b60ac..85a8b727bf 100644 --- a/src/ocamlorg_frontend/pages/changelog.eml +++ b/src/ocamlorg_frontend/pages/changelog.eml @@ -10,13 +10,6 @@ Layout.render

Read the latest releases and updates from the OCaml ecosystem.

- -

- - Note: The OCaml Changelog is experimental and is not yet endorsed by the maintainers of the Compiler, OCaml Platform and other featured projects.
- We'll work with the maintainers of the projects to agree on the format of the Changelog and the release process as we roll out a stable version. -
-

@@ -46,9 +39,9 @@ Layout.render

- <%s item.title %> + <%s item.title %>

- + <% (match item.tags with [] -> () | _ -> %>
<% item.tags |> List.iter (fun tag -> %> diff --git a/src/ocamlorg_frontend/pages/changelog_entry.eml b/src/ocamlorg_frontend/pages/changelog_entry.eml new file mode 100644 index 0000000000..d21249e404 --- /dev/null +++ b/src/ocamlorg_frontend/pages/changelog_entry.eml @@ -0,0 +1,52 @@ +let render (change : Data.Changelog.t) = +Layout.render +~title:"<%s change.title %> • OCaml Changelog" +~description:"<%s change.title %>" @@ +
+
+
+ + +
+

+ <%s change.title %> +

+ <% (match change.tags with [] -> () | _ -> %> +
    + <% change.tags |> List.iter (fun tag -> %> +
  • + + <%s tag %> + +
  • + <% ); %> +
+ <% ); %> +
+ +
+ +
+ <%s! change.body_html %> + <% (match change.changelog_html with | None -> () | Some changelog -> %> +
+ See full changelog + <%s! changelog %> +
+ <% ); %> +
+
+
+
+
\ No newline at end of file diff --git a/src/ocamlorg_web/lib/handler.ml b/src/ocamlorg_web/lib/handler.ml index fa15c23a84..674a2c450e 100644 --- a/src/ocamlorg_web/lib/handler.ml +++ b/src/ocamlorg_web/lib/handler.ml @@ -48,6 +48,11 @@ let changelog req = in Dream.html (Ocamlorg_frontend.changelog ?current_tag ~tags changes) + let changelog_entry req = + let slug = Dream.param req "id" in + let? change = Data.Changelog.get_by_slug slug in + Dream.html (Ocamlorg_frontend.changelog_entry change) + let success_story req = let slug = Dream.param req "id" in let? success_story = Data.Success_story.get_by_slug slug in diff --git a/src/ocamlorg_web/lib/router.ml b/src/ocamlorg_web/lib/router.ml index c719d3bae8..7999b155d0 100644 --- a/src/ocamlorg_web/lib/router.ml +++ b/src/ocamlorg_web/lib/router.ml @@ -29,6 +29,7 @@ let page_routes = Dream.get Url.platform Handler.platform; Dream.get Url.community Handler.community; Dream.get Url.changelog Handler.changelog; + Dream.get (Url.changelog_entry ":id") Handler.changelog_entry; Dream.get (Url.success_story ":id") Handler.success_story; Dream.get Url.industrial_users Handler.industrial_users; Dream.get Url.academic_users Handler.academic_users; diff --git a/tool/ood-gen/lib/changelog.ml b/tool/ood-gen/lib/changelog.ml index a481f913ee..19024c1ec2 100644 --- a/tool/ood-gen/lib/changelog.ml +++ b/tool/ood-gen/lib/changelog.ml @@ -44,7 +44,7 @@ let decode (fname, (head, body)) = let all () = Utils.map_files decode "changelog/*/*.md" - |> List.sort (fun a b -> String.compare b.date a.date) + |> List.sort (fun a b -> String.compare b.slug a.slug) let template () = Format.asprintf