This commit is contained in:
Dan Holmsand 2015-09-09 12:11:30 +02:00
parent 7284460ef7
commit 27ef8a42fd
2 changed files with 14 additions and 15 deletions

View File

@ -26,19 +26,18 @@
(tools/register-page index-page [#'intro/main] title)
(defroute "/" []
(dispatch [:set-content [#'intro/main] title]))
(dispatch [:set-page index-page]))
(defn demo []
[:div
[:div.nav
[:ul.nav
[:li.brand [link {:href index-page} "Reagent:"]]
[:li [link {:href index-page} "Intro"]]
[:li [link {:href news/url} "News"]]
[:li [:a github "GitHub"]]]]
@test-results
[tools/page-content]
[:div.nav>ul.nav
[:li.brand [link {:href index-page} "Reagent:"]]
[:li [link {:href index-page} "Intro"]]
[:li [link {:href news/url} "News"]]
[:li>a github "GitHub"]]
[:div @test-results]
[tools/main-content]
[github-badge]])
(defn init! []

View File

@ -34,9 +34,9 @@
;;; Configuration
(declare page-content)
(declare main-content)
(defonce config (r/atom {:body [#'page-content]
(defonce config (r/atom {:body [#'main-content]
:main-content [:div]
:pages #{}
:site-dir "outsite/public"
@ -118,10 +118,10 @@
(dispatch [:goto-page (:href props)])))
child])
(defn page-content []
(let [{:keys [main-content]} @config]
(assert (vector? main-content))
main-content))
(defn main-content []
(let [{comp :main-content} @config]
(assert (vector? comp))
comp))
;;; Static site generation