From 0647fb79dea80219ea0b0be2b315163d9a5d3ae2 Mon Sep 17 00:00:00 2001 From: Marius Peter Date: Sat, 7 Jun 2025 19:42:02 +0200 Subject: Routes.link_to now accepts arbitrary nodes as content. --- lib/routes.ml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/routes.ml') diff --git a/lib/routes.ml b/lib/routes.ml index 0778c18..c136152 100644 --- a/lib/routes.ml +++ b/lib/routes.ml @@ -12,7 +12,7 @@ type t = | Blob of string * string * string let%path root_path = "/" -let%path repo_path = "/%s" +let%path repo_path = "/%s/" let%path tag_path = "/%s/refs/%s" let%path commit_path = "/%s/commit/%s" let%path tree_path = "/%s/tree/%s/%s" @@ -26,5 +26,4 @@ let path_attr = function | Tree (repo, commit, path) -> path_attr href tree_path repo commit path | Blob (repo, commit, path) -> path_attr href blob_path repo commit path -let link_to label route = a [ path_attr route ] [ txt "%s" label ] -let li_of_repo repo = li [] [ link_to repo (Repo repo) ] +let link_to route content = a [ path_attr route ] [ content ] -- cgit v1.2.3