 (ns lambda-blog.templates.page
+  "Generic HTML page templates."
   (:refer-clojure :exclude [meta])
   (:require [lambda-blog.templates.bits :refer [javascript row text-centered]]
             [lambda-blog.utils :refer [pathcat]]

                 :href (link-or-pathcat path-to-root %)})
       stylesheets))

(defn header [{:keys [favicon path-to-root rss scripts stylesheets title]}]
  (t/head (t/meta {:charset :utf-8})
          (t/title title)
          (css path-to-root stylesheets)

                  (t/div {:class [:collapse :navbar-collapse :navbar-right :navbar-responsive-collapse]}
                         (navigation-template ent))))))

(defn page
  "Creates a generic HTML page composed of [[header]], [[navigation]], [[banner]] & [[footer]]. Page contents are created using `contents-template`."
  [contents-template entity]
  [(doctype :html)
   (t/html (header entity)
           (t/body (navigation entity)
