   (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 ^:export genpages [opts]
  (log "Generating site")
  (swap! config merge (js->clj opts :keywordize-keys true))
  (let [dir (:site-dir @config)
        timestamp (str "?" (js/Date.now))]
    (doseq [f (:pages @config)]
      (write-file (path-join dir (dbg (as-relative f)))
                  (gen-page f timestamp)))
    (write-resources dir))
  (log "Wrote site"))

(defn start! [site-config]

                 (js->clj js/pageConfig :keywordize-keys true))]
      (swap! config merge conf)
      (init-history)
      (r/render-component (:body @config)
                          (js/document.getElementById (:main-div @config))))))
