Add a helper to format an article's timestamp.
This commit is contained in:
@@ -13,6 +13,20 @@
|
||||
(fn [timestamp]
|
||||
(format timestamp "HH:mm MMM. do, yyyy"))))
|
||||
|
||||
(defn article-timestamp-factory
|
||||
[]
|
||||
(clj->js
|
||||
(fn [timestamp]
|
||||
(str "<time pubdate=\""
|
||||
(format timestamp "yyyy-MM-dd")
|
||||
"\" datetime=\""
|
||||
(format timestamp "yyyy-MM-dd")
|
||||
"\" title=\""
|
||||
(format timestamp "MMMM do, yyyy")
|
||||
"\">"
|
||||
(format timestamp "MMMM do, yyyy")
|
||||
"</time>"))))
|
||||
|
||||
(defn is-brief-factory
|
||||
[]
|
||||
(clj->js
|
||||
|
||||
@@ -20,6 +20,10 @@
|
||||
"full-timestamp"
|
||||
(helpers/full-timestamp-factory))
|
||||
|
||||
(.registerHelper (.-handlebars hbs)
|
||||
"article-timestamp"
|
||||
(helpers/article-timestamp-factory))
|
||||
|
||||
(.registerHelper (.-handlebars hbs)
|
||||
"truncatestring"
|
||||
(helpers/truncatestring-factory))
|
||||
|
||||
Reference in New Issue
Block a user