diff --git a/demo/reagentdemo/core.cljs b/demo/reagentdemo/core.cljs index 7519743..7e4a49c 100644 --- a/demo/reagentdemo/core.cljs +++ b/demo/reagentdemo/core.cljs @@ -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! [] diff --git a/demo/sitetools/core.cljs b/demo/sitetools/core.cljs index f2359a7..b209a79 100644 --- a/demo/sitetools/core.cljs +++ b/demo/sitetools/core.cljs @@ -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