[hugo/feat] show title and creat (or edit) time
This commit is contained in:
parent
f1642f5121
commit
6f7513ce82
2 changed files with 16 additions and 9 deletions
|
@ -58,7 +58,7 @@
|
|||
:title (.text title)
|
||||
:time (first (str/split (.text post-time) #"・"))}]
|
||||
(if hugo
|
||||
(.toString docs)
|
||||
content
|
||||
{:status 200
|
||||
:headers {"Content-Type" "application/json; charset=utf-8"}
|
||||
:body (wrap-json content)}))))
|
||||
|
|
|
@ -5,11 +5,18 @@
|
|||
|
||||
(defn build-hu-post
|
||||
[request]
|
||||
{:status 200
|
||||
:headers {"Content-Type" "text/html; charset=utf-8"}
|
||||
:body (str (hiccup/html {:escape-strings? false}
|
||||
[:html
|
||||
[:head
|
||||
[:meta {:name "referrer" :content "no-referrer"}]]
|
||||
[:body {:style "margin: auto;max-width: 65%;"}
|
||||
(handlers/fetch-hu-post request {:hugo true})]]))})
|
||||
(let [content (handlers/fetch-hu-post request {:hugo true})]
|
||||
{:status 200
|
||||
:headers {"Content-Type" "text/html; charset=utf-8"}
|
||||
:body (str
|
||||
(hiccup/html {:escape-strings? false}
|
||||
[:html
|
||||
[:head
|
||||
[:meta {:name "referrer" :content "no-referrer"}]]
|
||||
[:body {:style "margin: auto;max-width: 65%;"}
|
||||
[:div
|
||||
[:h1 (:title content)]
|
||||
[:time (:time content)]
|
||||
[:hr]]
|
||||
[:div
|
||||
(:content content)]]]))}))
|
||||
|
|
Loading…
Reference in a new issue