List three latest articles on index
This commit is contained in:
parent
24cdc17f3b
commit
96d3069ed1
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue