compile works again

This commit is contained in:
jem 2019-11-29 16:29:35 +01:00
parent fa3d903c01
commit 843e0eaaec

View file

@ -490,21 +490,20 @@
"Generates all the html and copies over resources specified in the config"
[]
(println (green "compiling assets..."))
(let [{:keys [^String site-url blog-prefix rss-name recent-posts sass-dest keep-files ignored-files previews?
author-root-uri theme debug? page-model page-root-uri ]
(let [{:keys [^String site-url blog-prefix rss-name recent-posts sass-dest keep-files ignored-files previews?
author-root-uri theme debug? page-model page-root-uri]
:as config} (read-config)
posts (map klipsify (add-prev-next (read-posts config)))
posts-by-tag (group-by-tags posts)
posts (tag-posts posts config)
latest-posts (->> posts (take recent-posts) vec)
klipsified-pages (map klipsify (read-pages config))
modelled-pages (cond
modelled-pages (cond
(= page-model :flat) klipsified-pages
(= page-model :hierarchic) (hierarchic/build-hierarchic-map page-root-uri klipsified-pages)
)
(= page-model :hierarchic) (hierarchic/build-hierarchic-map page-root-uri klipsified-pages))
home-page (->> modelled-pages
(filter #(boolean (:home? %)))
(first))
(filter #(boolean (:home? %)))
(first))
other-pages (->> modelled-pages
(remove #{home-page})
(add-prev-next))
@ -516,22 +515,25 @@
:latest-posts latest-posts
:pages other-pages
:home-page (if home-page
home-page
(assoc (first latest-posts) :layout "home.html"))
home-page
(assoc (first latest-posts) :layout "home.html"))
:archives-uri (page-uri "archives.html" config)
:index-uri (page-uri "index.html" config)
:tags-uri (page-uri "tags.html" config)
:rss-uri (cryogen-io/path "/" blog-prefix rss-name)
:site-url (if (.endsWith site-url "/") (.substring site-url 0 (dec (count site-url))) site-url)})]
:site-url (if (.endsWith site-url "/") (.substring site-url 0 (dec (count site-url))) site-url)})
file-resource-path (str "file:resources/templates/themes/" theme)
classpath-resource-path (str "templates/themes/" theme)]
(when debug?
(println (blue "debug: page-model:"))
(println "\t-->" (cyan page-model))
(println (blue "debug: home-page:"))
(println "\t-->" (cyan (-> params :home-page)))
)
(println "\t-->" (cyan (-> params :home-page))))
;; TODO: replace by file-resource-path or classpath-resource-path
(set-custom-resource-path! (str "file:resources/templates/themes/" theme))
(cryogen-io/wipe-public-folder keep-files)
(println (blue "copying theme resources"))
;; TODO: adjust for reading from jar
(cryogen-io/copy-resources-from-theme config)
(println (blue "copying resources"))
(cryogen-io/copy-resources config)
@ -557,9 +559,9 @@
(rss/make-filtered-channels config posts-by-tag)
(println (blue "compiling sass"))
(sass/compile-sass->css!
(merge (select-keys config [:sass-path :compass-path :sass-src :ignored-files])
{:sass-dest (cryogen-io/path ".." "public" blog-prefix sass-dest)
:base-dir "resources/templates/"}))))
(merge (select-keys config [:sass-path :compass-path :sass-src :ignored-files])
{:sass-dest (cryogen-io/path ".." "public" blog-prefix sass-dest)
:base-dir "resources/templates/"}))))
(defn compile-assets-timed []
(time