       (map (fn [ch]
         (list [:a {:href (rel-url (:id b) (:num ch) (count (:chapters b)))} (:num ch)] " "))))])
 
-(defn toc [m]
+(defn toc [m baseurl canonical]
   (str "<!DOCTYPE html>"
     (html
       [:html {:lang "en"}

  [{book-id :book-id
    verses :verses
    :as ch}
    prev-ch
    next-ch]
  (str
    "<!DOCTYPE html>"
    (html

        output-dir (first output-dir)]
    (write! output-dir "styles.css" (style))
    (write! output-dir "hiliter.js" (js))
    (write! output-dir "robots.txt" (robots baseurl))
    (write! output-dir "sitemap.xml" (sitemap all-chapters baseurl))
    (write! output-dir "7ce12f75-f371-4e85-a3e9-b7749a65f140.html" (toc m baseurl canonical))
    (dorun
      (map-indexed
        #(write!
          output-dir
          (rel-url %2)
          (chapter
            %2
            (prev-chapter all-chapters %1)
            (next-chapter all-chapters %1)
            baseurl
            canonical))
        all-chapters))))