From 8ab5f20f532bc6e9de38ee457b0ef8dd30c80374 Mon Sep 17 00:00:00 2001 From: Marius Peter Date: Sun, 19 Jan 2025 20:00:18 +0100 Subject: Initial commit for ogit. --- lib/helpers/html_helpers.ml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 lib/helpers/html_helpers.ml (limited to 'lib/helpers/html_helpers.ml') diff --git a/lib/helpers/html_helpers.ml b/lib/helpers/html_helpers.ml new file mode 100644 index 0000000..da5addc --- /dev/null +++ b/lib/helpers/html_helpers.ml @@ -0,0 +1,18 @@ +(* Helper function to generate links for repositories *) +let generate_repo_links () = + let git_dir = Filename.concat (Unix.getenv "HOME") "git" in + if Sys.file_exists git_dir && Sys.is_directory git_dir then + Sys.readdir git_dir + |> Array.to_list + |> List.map (fun repo -> Printf.sprintf "
  • %s
  • " repo repo) + |> String.concat "" + else + "
  • Error: '~/git' directory not found.
  • " + +(* Page layout function *) +let page_layout ~content = + "" + ^ Layouts.Header.header () + ^ Layouts.Topnav.topnav () + ^ "
    " ^ content ^ "
    " + ^ "" -- cgit v1.2.3