date parsing

This commit is contained in:
Dan Frumin 2020-08-28 18:12:26 +02:00
parent 6b65794087
commit e6b1b304ab
3 changed files with 7 additions and 2 deletions

4
README
View File

@ -1 +1,5 @@
UwU
Requirements:
- calendar
- ISO8601

View File

@ -1,3 +1,3 @@
(executable
(name webcc)
(libraries omd))
(libraries omd ISO8601))

View File

@ -77,10 +77,11 @@ let process ic oc =
| None -> "-"
in
let md = Omd.of_channel ic in
let date = ISO8601.Permissive.date (lookup_metadata "date") in
let html = format_post
~title:(lookup_metadata "title")
~tags:(lookup_metadata "tags")
~date:(lookup_metadata "date")
~date:(ISO8601.Permissive.string_of_date date)
~contents:(Omd.to_html md)
in
output_string oc html