[OCaml] Mobile-friendly clone of cgit.
Update helper modules.
Changed files
lib/helpers/file_helpers.ml
@@ -3,5 +3,4 @@
3
3
Array.to_list (Sys.readdir dir)
4
4
|> List.map (fun file -> Printf.sprintf "<li>%s</li>" file)
5
5
|> String.concat ""
6
Removed:
with _ ->
7
Removed:
"<li>Error: Unable to read directory</li>"
6
Added:
with _ -> "<li>Error: Unable to read directory</li>"
lib/helpers/html_helpers.ml
@@ -1,18 +0,0 @@
1
Removed:
(* Helper function to generate links for repositories *)
2
Removed:
let generate_repo_links () =
3
Removed:
let git_dir = Filename.concat (Unix.getenv "HOME") "git" in
4
Removed:
if Sys.file_exists git_dir && Sys.is_directory git_dir then
5
Removed:
Sys.readdir git_dir
6
Removed:
|> Array.to_list
7
Removed:
|> List.map (fun repo -> Printf.sprintf "<li><a href='/%s/tree'>%s</a></li>" repo repo)
8
Removed:
|> String.concat ""
9
Removed:
else
10
Removed:
"<li>Error: '~/git' directory not found.</li>"
11
Removed:
12
Removed:
(* Page layout function *)
13
Removed:
let page_layout ~content =
14
Removed:
"<html><body>"
15
Removed:
^ Layouts.Header.header ()
16
Removed:
^ Layouts.Topnav.topnav ()
17
Removed:
^ "<main>" ^ content ^ "</main>"
18
Removed:
^ "</body></html>"