fix resolve name shadowing and format string type errors

- Rename 'title' parameter to 'page_title' in Layout.page_header to avoid shadowing by HTML.title inside local open - Rename 'title' binding to 'commit_title' in Repo.li_of_commit for the same reason - Use class_ format string directly instead of wrapping with Printf.sprintf (dream-html 3.11.2 API)

Commit
78df5ee7ddcca8c6a08d9cec994efae76da114f3
Author
Kiro <kiro@amazon.com>
Author date
Committer
Marius Peter <dev@marius-peter.com>
Committer date
Changed files
lib/views/layout.ml
index b53e2a78..9a7f346f 100644..100644
@@ -48,7 +48,7 @@
48 48 ul [] (List.map li_of_item nav_items);
49 49 ])
50 50
51 Removed: let page_header ~has_repo title subtitle =
51 Added: let page_header ~has_repo page_title subtitle =
52 52 let subtitle =
53 53 if String.starts_with ~prefix:"Unnamed repository" subtitle then ""
54 54 else subtitle
@@ -68,7 +68,7 @@
68 68 role `presentation;
69 69 class_ "site-logo";
70 70 ];
71 Removed: h1 [] [ txt "%s" title ];
71 Added: h1 [] [ txt "%s" page_title ];
72 72 ]
73 73 @
74 74 if subtitle = "" then []
lib/views/repo.ml
index 2c098546..422a0584 100644..100644
@@ -104,7 +104,7 @@
104 104 (if years = 1 then "" else "s")
105 105 in
106 106 let summary = commit_summary commit.message in
107 Removed: let commit_type, title = parse_conventional summary in
107 Added: let commit_type, commit_title = parse_conventional summary in
108 108 let timestamp_span =
109 109 HTML.(
110 110 span [ class_ "timestamp" ] [ txt "%s" (timestamp commit.author.date) ])
@@ -113,12 +113,11 @@
113 113 match commit_type with
114 114 | None -> HTML.null []
115 115 | Some t ->
116 Removed: HTML.(
117 Removed: span
118 Removed: [ class_ (Printf.sprintf "commit-pill commit-pill-%s" t) ]
119 Removed: [ txt "%s" t ])
116 Added: HTML.(span [ class_ "commit-pill commit-pill-%s" t ] [ txt "%s" t ])
120 117 in
121 Removed: let title_span = HTML.(span [ class_ "commit-title" ] [ txt "%s" title ]) in
118 Added: let title_span =
119 Added: HTML.(span [ class_ "commit-title" ] [ txt "%s" commit_title ])
120 Added: in
122 121 let ago_span =
123 122 HTML.(
124 123 span [ class_ "commit-ago" ] [ txt "%s" (time_ago commit.author.date) ])