   (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))))))

    (apply (.' path :join) paths)))

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

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

                         :js-file "js/main.js"
                         :js-dir "js/out"
                         :main-div "main-content"
                         :default-title ""}))

(defonce history nil)

(defn demo-handler [state [id v1 v2 :as event]]
  (case id
    :content (do
               (let [title (if v2
                             (str (:title-prefix state) v2)
                             (str (:default-title state)))]
                 (when r/is-client
                   (r/next-tick #(set! js/document.title title)))
                 (assoc state
