   (let [depth (-> #"/" (re-seq (as-relative page)) count)]
     (str (->> "../" (repeat depth) (apply str)) href)))
 
-(defn body []
-  (let [b (:body @config)]
-    (assert (vector? b) (str "body is not a vector: " b))
-    b))
-
 (defn danger [t s]
   [t {:dangerouslySetInnerHTML {:__html s}}])
 
-(defn html-template [{:keys [title body timestamp page-conf
-                             req]}]
-  (let [{:keys [js-file css-file main-div]} @config
-        main (str js-file timestamp)]
+(defn html-template [{:keys [title body-html timestamp page-conf
+                             js-file css-file main-div]}]
+  (let [main (str js-file timestamp)]
     (r/render-to-static-markup
      [:html
       [:head

(defn path-join [& paths]
  (apply (.' (js/require "path") :join) paths))

(defn read-css []
  (string/join "\n" (map read-file (:css-infiles @config))))

(defn write-resources [dir]
  (write-file (path-join dir (:css-file @config))
              (read-css)))


;;; Main entry points

(defn ^:export genpages [opts]
  (log "Generating site")
  (swap! config merge (js->clj opts :keywordize-keys true))
  (let [{:keys [site-dir pages] :as conf} @config
        conf (assoc conf :timestamp (str "?" (js/Date.now)))]
    (doseq [f pages]
      (write-file (path-join site-dir (as-relative f))
                  (gen-page f conf)))
    (write-resources site-dir conf))
  (log "Wrote site"))

(defn start! [site-config]
