   (swap! config merge site-config)
   (when r/is-client
     (let [conf (when (exists? js/pageConfig)
-                 (js->clj js/pageConfig :keywordize-keys true))
-          page-name (:page-name conf)]
+                 (js->clj js/pageConfig :keywordize-keys true))]
       (swap! config merge conf)
       (init-history)
       (r/render-component (body)
-                          (.' js/document getElementById
-                              (:main-div @config))))))
+                          (js/document.getElementById (:main-div @config))))))

  (dispatch [:set-page page-name])
  (let [b (r/render-component-to-string (body))]
    (str "<!doctype html>"
         (html-template {:title (:title @config) ;;(get-title)
                         :body b
                         :page-conf {:allow-html5-history true
                                     :page-name page-name}
                         :timestamp timestamp}))))

(defn mkdirs [f]

  (let [fs (or (.-rswapfs a)
               (set! (.-rswapfs a) (array)))]
    (.push fs #(apply f % args))
    (if (< 1 (alength fs))
      nil
      (let [f' (fn [state]
                 ;;;; TODO: This could throw
                 (let [s ((aget fs 0) state)]
                   (.shift fs)
                   (if (-> fs alength pos?)
                     (recur s)
                     s)))]
        (swap! a f')))))
