[hugo/feat] show title and creat (or edit) time

This commit is contained in:
SouthFox 2023-08-29 15:41:17 +08:00
parent f1642f5121
commit 6f7513ce82
2 changed files with 16 additions and 9 deletions

View file

@ -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)}))))

View file

@ -5,11 +5,18 @@
(defn build-hu-post
[request]
(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}
: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})]]))})
[:div
[:h1 (:title content)]
[:time (:time content)]
[:hr]]
[:div
(:content content)]]]))}))