From 645e815ebe11dbb86781c3eb645d3d67cd62cf7c Mon Sep 17 00:00:00 2001 From: polwex Date: Fri, 27 Jun 2025 16:34:09 +0700 Subject: nice nice. lsp still doesnt work tho --- lib/pages/BlogIndex.mlx | 76 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 lib/pages/BlogIndex.mlx (limited to 'lib/pages/BlogIndex.mlx') diff --git a/lib/pages/BlogIndex.mlx b/lib/pages/BlogIndex.mlx new file mode 100644 index 0000000..3e036aa --- /dev/null +++ b/lib/pages/BlogIndex.mlx @@ -0,0 +1,76 @@ +open Shared + +let header ~title () =

title

+ +let page = + + +
(React.string "Some content goes here")
+ + +;; + +module Layout = struct + let[@react.component] make ~children = + + + (React.string "Bloody Shovel 5") + + + + children + + ;; +end + +module PostPreviews = struct + let[@react.component] make ~(conn : Query.conn) = + let posts = + match Query.get_poasts () conn with + | Error _err -> [] + | Ok posts -> posts + in + let tests = "This is 'a 'weird " in +
+ (match posts with + | [] -> React.string "No posts" + | posts -> + let ps = + posts + |> List.map (fun (p : Query.post_summary) -> + Logs.info (fun d -> d "poast %s\n" p.title); +

(React.string p.title)

) + in + let pp = React.string tests :: ps in + pp |> Array.of_list |> React.array) +
+ ;; +end + +let[@react.component] make (conn : Query.conn) = + +
+ +
+ +
+
+
+
+;; + +(* let[@react.component] make (conn : Query.conn) = *) +(* let posts = *) +(* match Query.get_poasts () conn with *) +(* | Error _err -> [] *) +(* | Ok posts -> posts *) +(* in *) +(*
*) +(* (match posts with *) +(* | [] -> React.string "No posts" *) +(* | hd :: _tl -> React.string hd.title) *) +(*
*) +(* ;; *) + +(* # formatter = {command = "ocamlformat-mlx", args = ["-", "--impl"]} *) +(* List.map (fun _p ->

(React.string "wtf")

) posts |> React.list *) -- cgit v1.2.3