renamed date related functions

This commit is contained in:
Stavros Polymenis 2016-09-21 23:03:13 +01:00
parent 660c8637ad
commit 65753b2be1
2 changed files with 2 additions and 5 deletions

View File

@ -5,9 +5,6 @@ let logarion_head ?(style="/style.css") t =
let of_ymd ymd =
let ymd_title = Ymd.(ymd.meta.title) in
let ymd_date = match Ymd.(ymd.meta.date.published) with
| Some t -> Some t
| None -> Ymd.(ymd.meta.date.edited) in
let ymd_body = Omd.to_html (Omd.of_string Ymd.(ymd.body)) in
html (logarion_head ymd_title)
(body [
@ -15,7 +12,7 @@ let of_ymd ymd =
h1 [Unsafe.data ymd_title];
details
(summary [Unsafe.data Ymd.(ymd.meta.abstract)])
[time ~a:[a_datetime (Ymd.(to_rfc ymd_date))] []];
[time ~a:[a_datetime (Ymd.(rfc_string_of ymd.meta.date.published))] []];
];
Unsafe.data ymd_body;
footer [p []];

View File

@ -34,7 +34,7 @@ let ymd_of_body_pairs pairs =
| "title" -> of_str ymd (ymd_meta |-- meta_title) value
| "author_name" -> of_str ymd (ymd_meta |-- meta_author |-- author_name) value
| "author_email" -> of_str ymd (ymd_meta |-- meta_author |-- author_email) value
| "publish_date" -> ((ymd_meta |-- meta_date |-- date_published) ^= of_rfc (normal value)) ymd
| "publish_date" -> ((ymd_meta |-- meta_date |-- date_published) ^= date_of (normal value)) ymd
| "topics" -> of_str_list ymd (ymd_meta |-- meta_topics) value
| "categories" -> of_str_list ymd (ymd_meta |-- meta_categories) value
| "keywords" -> of_str_list ymd (ymd_meta |-- meta_keywords) value