added todos

This commit is contained in:
jem 2019-12-27 13:21:01 +01:00
parent 297f37c469
commit bbae94fa8c

View file

@ -493,60 +493,42 @@
sass-dest keep-files ignored-files previews? sass-dest keep-files ignored-files previews?
author-root-uri theme debug? page-model author-root-uri theme debug? page-model
page-root-uri resources] page-root-uri resources]
:as config} :as config} (read-config)
(read-config) posts (map klipsify (add-prev-next (read-posts config)))
posts posts-by-tag (group-by-tags posts)
(map klipsify (add-prev-next (read-posts config))) posts (tag-posts posts config)
posts-by-tag latest-posts (->> posts (take recent-posts) vec)
(group-by-tags posts) klipsified-pages (map klipsify (read-pages config))
posts modelled-pages (cond
(tag-posts posts config) (= page-model :flat) klipsified-pages
latest-posts (= page-model :hierarchic) (hierarchic/build-hierarchic-map page-root-uri klipsified-pages))
(->> posts (take recent-posts) vec) home-page (->> modelled-pages
klipsified-pages (filter #(boolean (:home? %)))
(map klipsify (read-pages config)) (first))
modelled-pages other-pages (->> modelled-pages
(cond (remove #{home-page})
(= page-model :flat) klipsified-pages (add-prev-next))
(= page-model :hierarchic) (hierarchic/build-hierarchic-map page-root-uri klipsified-pages)) params (merge config
home-page {:today (java.util.Date.)
(->> modelled-pages :title (:site-title config)
(filter #(boolean (:home? %))) :active-page "home"
(first)) :tags (map (partial tag-info config) (keys posts-by-tag))
other-pages :latest-posts latest-posts
(->> modelled-pages :pages other-pages
(remove #{home-page}) :home-page (if home-page
(add-prev-next)) home-page
params (assoc (first latest-posts) :layout "home.html"))
(merge config :archives-uri (page-uri "archives.html" config)
{:today (java.util.Date.) :index-uri (page-uri "index.html" config)
:title (:site-title config) :tags-uri (page-uri "tags.html" config)
:active-page "home" :rss-uri (cryogen-io/path "/" blog-prefix rss-name)
:tags (map (partial tag-info config) (keys posts-by-tag)) :site-url (if (.endsWith site-url "/") (.substring site-url 0 (dec (count site-url))) site-url)})
:latest-posts latest-posts file-resource-prefix "resources/"
:pages other-pages resource-prefix (str "templates/themes/" theme)
:home-page (if home-page file-uri (:uri
home-page (cp-io/resource-from-cp-or-fs
(assoc (first latest-posts) :layout "home.html")) file-resource-prefix resource-prefix ""
:archives-uri (page-uri "archives.html" config) :from-cp false))]
: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)})
file-resource-prefix
"resources/"
resource-prefix
(str "templates/themes/" theme)
file-uri
(:uri
(cp-io/resource-from-cp-or-fs
file-resource-prefix resource-prefix ""
:from-cp false))
cp-uri
(:uri
(cp-io/resource-from-cp-or-fs
file-resource-prefix resource-prefix ""
:from-fs false))]
(when debug? (when debug?
(println (blue "debug: page-model:")) (println (blue "debug: page-model:"))
(println "\t-->" (cyan page-model)) (println "\t-->" (cyan page-model))
@ -554,7 +536,8 @@
(println "\t-->" (cyan file-uri)) (println "\t-->" (cyan file-uri))
(println (blue "debug: home-page:")) (println (blue "debug: home-page:"))
(println "\t-->" (cyan (-> params :home-page)))) (println "\t-->" (cyan (-> params :home-page))))
;; TODO: inline in compile* fns ;; TODO: 1. Copy theme/html from fs & cp -> target/theme/html
;; TODO: 2. use target/theme as custome-resource-path
(set-custom-resource-path! (.toString file-uri)) (set-custom-resource-path! (.toString file-uri))
;(cryogen-io/wipe-public-folder keep-files) ;(cryogen-io/wipe-public-folder keep-files)
(cp-io/delete-resource-recursive! (cp-io/path "resources/public" blog-prefix)) (cp-io/delete-resource-recursive! (cp-io/path "resources/public" blog-prefix))
@ -578,7 +561,6 @@
ignored-files) ignored-files)
; TODO: Hier weitermachen ; TODO: Hier weitermachen
(compile-pages params modelled-pages) (compile-pages params modelled-pages)
;(compile-pages params modelled-pages file-uri cp-uri)
(compile-posts params posts) (compile-posts params posts)
(compile-tags params posts-by-tag) (compile-tags params posts-by-tag)
(compile-tags-page params) (compile-tags-page params)