Cleanup
This commit is contained in:
parent
b8c5b71dbb
commit
73338935fa
1 changed files with 11 additions and 18 deletions
|
@ -184,12 +184,11 @@
|
||||||
(render-file "templates/html/layouts/page.html"
|
(render-file "templates/html/layouts/page.html"
|
||||||
(merge default-params
|
(merge default-params
|
||||||
{:servlet-context "../"
|
{:servlet-context "../"
|
||||||
:page page
|
:page page}))))))
|
||||||
:asset-url asset-url}))))))
|
|
||||||
|
|
||||||
(defn compile-posts
|
(defn compile-posts
|
||||||
"Compiles all the posts into html and spits them out into the public folder"
|
"Compiles all the posts into html and spits them out into the public folder"
|
||||||
[default-params posts {:keys [blog-prefix post-root disqus-shortname asset-url]}]
|
[default-params posts {:keys [blog-prefix post-root disqus-shortname]}]
|
||||||
(when-not (empty? posts)
|
(when-not (empty? posts)
|
||||||
(println (blue "compiling posts"))
|
(println (blue "compiling posts"))
|
||||||
(create-folder (str blog-prefix post-root))
|
(create-folder (str blog-prefix post-root))
|
||||||
|
@ -200,8 +199,7 @@
|
||||||
(merge default-params
|
(merge default-params
|
||||||
{:servlet-context "../"
|
{:servlet-context "../"
|
||||||
:post post
|
:post post
|
||||||
:disqus-shortname disqus-shortname
|
:disqus-shortname disqus-shortname}))))))
|
||||||
:asset-url asset-url}))))))
|
|
||||||
|
|
||||||
(defn compile-tags
|
(defn compile-tags
|
||||||
"Compiles all the tag pages into html and spits them out into the public folder"
|
"Compiles all the tag pages into html and spits them out into the public folder"
|
||||||
|
@ -220,15 +218,14 @@
|
||||||
|
|
||||||
(defn compile-index
|
(defn compile-index
|
||||||
"Compiles the index page into html and spits it out into the public folder"
|
"Compiles the index page into html and spits it out into the public folder"
|
||||||
[default-params {:keys [blog-prefix disqus? asset-url]}]
|
[default-params {:keys [blog-prefix disqus?]}]
|
||||||
(println (blue "compiling index"))
|
(println (blue "compiling index"))
|
||||||
(spit (str public blog-prefix "/index.html")
|
(spit (str public blog-prefix "/index.html")
|
||||||
(render-file "templates/html/layouts/home.html"
|
(render-file "templates/html/layouts/home.html"
|
||||||
(merge default-params
|
(merge default-params
|
||||||
{:home true
|
{:home true
|
||||||
:disqus? disqus?
|
:disqus? disqus?
|
||||||
:post (get-in default-params [:latest-posts 0])
|
:post (get-in default-params [:latest-posts 0])}))))
|
||||||
:asset-url asset-url}))))
|
|
||||||
|
|
||||||
(defn compile-archives
|
(defn compile-archives
|
||||||
"Compiles the archives page into html and spits it out into the public folder"
|
"Compiles the archives page into html and spits it out into the public folder"
|
||||||
|
@ -258,16 +255,12 @@
|
||||||
(update-in [:sass-dest] (fnil str "css"))
|
(update-in [:sass-dest] (fnil str "css"))
|
||||||
(update-in [:post-date-format] (fnil str "yyyy-MM-dd"))
|
(update-in [:post-date-format] (fnil str "yyyy-MM-dd"))
|
||||||
(update-in [:keep-files] (fnil seq []))
|
(update-in [:keep-files] (fnil seq []))
|
||||||
(update-in [:ignored-files] (fnil seq [#"^\.#.*" #".*\.swp$"])))
|
(update-in [:ignored-files] (fnil seq [#"^\.#.*" #".*\.swp$"])))]
|
||||||
site-url (:site-url config)
|
|
||||||
blog-prefix (:blog-prefix config)]
|
|
||||||
(merge
|
(merge
|
||||||
config
|
config
|
||||||
{:page-root (root-path :page-root config)
|
{:page-root (root-path :page-root config)
|
||||||
:post-root (root-path :post-root config)
|
:post-root (root-path :post-root config)
|
||||||
:tag-root (root-path :tag-root config)
|
:tag-root (root-path :tag-root config)})))
|
||||||
:asset-root (str (if (.endsWith site-url "/") (apply str (butlast site-url)) site-url)
|
|
||||||
blog-prefix)})))
|
|
||||||
|
|
||||||
(defn compile-assets
|
(defn compile-assets
|
||||||
"Generates all the html and copies over resources specified in the config"
|
"Generates all the html and copies over resources specified in the config"
|
||||||
|
|
Loading…
Reference in a new issue