diff --git a/src/task.ml b/src/task.ml index e1f9fc0..18a3b2f 100644 --- a/src/task.ml +++ b/src/task.ml @@ -99,4 +99,11 @@ let generate_contact target = let generate_index target = let* articles = articles in + let rec take n xs = + match n, xs with + | 0, _ | _, [] -> [] + | _, x :: xs -> x :: take (pred n) xs + in + let open Build in + let articles = articles >>^ take 3 in with_layout (module Model.Articles) articles "pages/index.md" (index_html target)