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