Add human readable date, keep machine readable
This commit is contained in:
parent
9f879be71b
commit
76b3ca0d33
|
@ -6,7 +6,7 @@ import std.datetime;
|
|||
import dyaml;
|
||||
|
||||
string toHumanString(DateTime value) {
|
||||
return to!string(value.year) ~ "-" ~ to!string(ubyte(value.month)) ~ "-" ~ to!string(value.day);
|
||||
return to!string(value.day) ~ "-" ~ to!string(ubyte(value.month)) ~ "-" ~ to!string(value.year);
|
||||
}
|
||||
|
||||
T getOr(T)(Node node, string key, T or) {
|
||||
|
|
|
@ -19,7 +19,7 @@ block content
|
|||
h1.title(itemprop="headline") #{content.title}
|
||||
p.subtitle
|
||||
| By <span itemprop="author">#{content.author}</span>
|
||||
| on <span itemprop="datePublished">#{content.firstPublished.toHumanString}</span>
|
||||
| on <time datetime="#{content.firstPublished.toISOExtString}" itemprop="datePublished">#{content.firstPublished.toHumanString}</time>
|
||||
- if (content.isModified)
|
||||
|, updated on <span itemprop="dateModified">#{content.updated.toHumanString}</span>
|
||||
|, updated on <time datetime="#{content.updated.toISOExtString}" itemprop="dateModified">#{content.updated.toHumanString}</time>
|
||||
section(itemprop="articleBody") !{content.content}
|
||||
|
|
Loading…
Reference in a new issue