Sort articles
This commit is contained in:
parent
c0854750d3
commit
0550bb1227
|
@ -67,6 +67,12 @@ module Articles = struct
|
|||
|
||||
let make path article = (path, article)
|
||||
|
||||
let sort articles =
|
||||
List.sort
|
||||
(fun (_, a) (_, b) ->
|
||||
~-(Date.compare a.Article.date b.Article.date))
|
||||
articles
|
||||
|
||||
let inject (type a) (module D : Key_value.DESCRIBABLE with type t = a) articles =
|
||||
D.[
|
||||
"articles",
|
||||
|
|
|
@ -76,7 +76,7 @@ let articles =
|
|||
Metaformat.read_file_with_metadata (module Model.Article) path
|
||||
>>^ fun (meta, _data) ->
|
||||
(Model.article_path path, meta))
|
||||
(fun articles () -> articles)
|
||||
(fun articles () -> Model.Articles.sort articles)
|
||||
|
||||
let generate_archive target =
|
||||
let* articles = articles in
|
||||
|
|
Loading…
Reference in a new issue