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

View File

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