   (swap! config merge (js->clj opts :keywordize-keys true))
   (let [dir (:site-dir @config)
         timestamp (str "?" (.' js/Date now))]
-    (doseq [f (keys (:page-map @config))]
-      (write-file (path-join dir f)
+    (doseq [f (:pages @config)]
+      (write-file (path-join dir (dbg (as-relative f)))
                   (gen-page f timestamp)))
     (write-resources dir))
   (log "Wrote site"))

       [:meta {:charset "utf-8"}]
       [:meta {:name 'viewport
               :content "width=device-width, initial-scale=1.0"}]
       [:base {:href (prefix "")}]
       [:link {:href (str css-file timestamp) :rel 'stylesheet}]
       [:title title]]
      [:body

       [:script {:src main :type "text/javascript"}]]])))

(defn gen-page [page-name timestamp]
  ;; (reset! page page-name)
  (dispatch [:set-page page-name])
  (let [b (r/render-component-to-string (body))]
    (str "<!doctype html>"
         (html-template {:title (:title @config) ;;(get-title)
