diff options
author | Marius Peter <marius.peter@tutanota.com> | 2025-06-07 19:42:02 +0200 |
---|---|---|
committer | Marius Peter <marius.peter@tutanota.com> | 2025-06-07 19:42:02 +0200 |
commit | 0647fb79dea80219ea0b0be2b315163d9a5d3ae2 (patch) | |
tree | 0e098461d5e6e7343082f3905ea7a565d50b44df /lib/routes.ml | |
parent | 21cbcf2e8b69403f3973fa19e5e96bee5ba870b7 (diff) |
Routes.link_to now accepts arbitrary nodes as content.
Diffstat (limited to 'lib/routes.ml')
-rw-r--r-- | lib/routes.ml | 5 |
1 files changed, 2 insertions, 3 deletions
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 ] |