diff --git a/src/main/backend/handlers.clj b/src/main/backend/handlers.clj index 1bc203e..c540416 100644 --- a/src/main/backend/handlers.clj +++ b/src/main/backend/handlers.clj @@ -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)})))) diff --git a/src/main/backend/hugo/site.clj b/src/main/backend/hugo/site.clj index 12dfcf0..067c94a 100644 --- a/src/main/backend/hugo/site.clj +++ b/src/main/backend/hugo/site.clj @@ -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)]]]))}))