2015-03-21 12:53:37 +00:00
|
|
|
(ns reagentdemo.core
|
2015-07-31 13:13:27 +00:00
|
|
|
(:require [reagent.core :as r]
|
2014-11-29 17:30:24 +00:00
|
|
|
[reagent.interop :as i :refer-macros [.' .!]]
|
2014-01-06 11:46:58 +00:00
|
|
|
[clojure.string :as string]
|
2015-02-10 13:18:56 +00:00
|
|
|
[sitetools.core :as tools :refer [link]]
|
2014-01-21 10:50:08 +00:00
|
|
|
[reagentdemo.common :as common :refer [demo-component]]
|
2014-01-18 10:31:43 +00:00
|
|
|
[reagentdemo.intro :as intro]
|
2014-01-20 08:42:16 +00:00
|
|
|
[reagentdemo.news :as news]
|
2014-01-17 10:12:11 +00:00
|
|
|
[reagent.debug :refer-macros [dbg println]]))
|
2014-01-02 13:04:30 +00:00
|
|
|
|
2015-07-31 13:13:27 +00:00
|
|
|
(def test-results (r/atom nil))
|
2014-01-17 11:35:40 +00:00
|
|
|
|
2014-11-06 19:21:38 +00:00
|
|
|
(def github {:href "https://github.com/reagent-project/reagent"})
|
2014-01-22 07:40:04 +00:00
|
|
|
|
2014-01-07 16:01:28 +00:00
|
|
|
(defn github-badge []
|
|
|
|
[:a.github-badge
|
2014-01-22 07:40:04 +00:00
|
|
|
github
|
2014-01-07 16:01:28 +00:00
|
|
|
[:img {:style {:position "absolute" :top 0 :left 0 :border 0}
|
2014-01-22 07:40:04 +00:00
|
|
|
:alt "Fork me on GitHub"
|
|
|
|
:src "https://s3.amazonaws.com/github/ribbons/forkme_left_orange_ff7600.png"}]])
|
2014-01-07 16:01:28 +00:00
|
|
|
|
2014-11-29 17:30:24 +00:00
|
|
|
(def index-page "index.html")
|
|
|
|
(def news-page "news/index.html")
|
|
|
|
|
2015-01-31 21:02:30 +00:00
|
|
|
(tools/register-page index-page [#'intro/main]
|
2014-11-29 18:51:45 +00:00
|
|
|
"Reagent: Minimalistic React for ClojureScript")
|
2015-01-31 21:02:30 +00:00
|
|
|
(tools/register-page news-page [#'news/main]
|
2014-11-29 18:51:45 +00:00
|
|
|
"Reagent news")
|
2014-11-29 17:30:24 +00:00
|
|
|
|
2014-01-02 13:04:30 +00:00
|
|
|
(defn demo []
|
2014-01-06 18:16:53 +00:00
|
|
|
[:div
|
2014-01-20 08:42:16 +00:00
|
|
|
[:div.nav
|
|
|
|
[:ul.nav
|
2014-11-29 17:30:24 +00:00
|
|
|
[:li.brand [link {:href index-page} "Reagent:"]]
|
|
|
|
[:li [link {:href index-page} "Intro"]]
|
|
|
|
[:li [link {:href news-page} "News"]]
|
2014-01-22 07:40:04 +00:00
|
|
|
[:li [:a github "GitHub"]]]]
|
2015-02-10 17:20:48 +00:00
|
|
|
@test-results
|
2014-11-29 17:30:24 +00:00
|
|
|
[tools/page-content]
|
2014-01-09 13:37:11 +00:00
|
|
|
[github-badge]])
|
2014-01-05 10:16:01 +00:00
|
|
|
|
2015-03-21 12:53:37 +00:00
|
|
|
(defn init! []
|
|
|
|
(tools/start! {:body [#'demo]
|
|
|
|
:css-infiles ["site/public/css/examples.css"
|
|
|
|
"site/public/css/main.css"]}))
|
|
|
|
|
|
|
|
(init!)
|