[OCaml] Mobile-friendly clone of cgit.
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)
Changed files
lib/views/layout.ml
@@ -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
@@ -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) ])