mirror of https://github.com/status-im/reagent.git
Tweak site-building
Allow files in outsite to be opened directly
This commit is contained in:
parent
73f5ee53dc
commit
a6cb21105a
4
Makefile
4
Makefile
|
@ -34,11 +34,11 @@ clean:
|
||||||
## Subtargets
|
## Subtargets
|
||||||
|
|
||||||
figwheel: trigger-build
|
figwheel: trigger-build
|
||||||
@echo "Will start figwheel server at:\nhttp://127.0.0.1:$(PORT)\n\n"
|
@echo "Will start figwheel server at: http://127.0.0.1:$(PORT)\n"
|
||||||
lein with-profile $(PROF), figwheel
|
lein with-profile $(PROF), figwheel
|
||||||
|
|
||||||
serve-site: trigger-build
|
serve-site: trigger-build
|
||||||
@echo "Starting site at:\nhttp://127.0.0.1:$(PORT)/public\n\n"
|
@echo "Starting site at: http://127.0.0.1:$(PORT)/public\n"
|
||||||
( trap "kill 0" SIGINT SIGTERM EXIT; \
|
( trap "kill 0" SIGINT SIGTERM EXIT; \
|
||||||
( cd $(SITEDIR)/.. && python -m SimpleHTTPServer $(PORT) & ); \
|
( cd $(SITEDIR)/.. && python -m SimpleHTTPServer $(PORT) & ); \
|
||||||
lein with-profile $(PROF), cljsbuild auto )
|
lein with-profile $(PROF), cljsbuild auto )
|
||||||
|
|
|
@ -132,4 +132,4 @@
|
||||||
[demo-component {:comp geometry-example}]])]]))
|
[demo-component {:comp geometry-example}]])]]))
|
||||||
|
|
||||||
(tools/register-page url (fn [] [main])
|
(tools/register-page url (fn [] [main])
|
||||||
(str "Reagent: " title))
|
(str "Reagent 0.4.0: " title))
|
||||||
|
|
|
@ -103,7 +103,8 @@
|
||||||
(if (use-html5-history)
|
(if (use-html5-history)
|
||||||
(doto (Html5History.)
|
(doto (Html5History.)
|
||||||
(.setUseFragment false))
|
(.setUseFragment false))
|
||||||
(History.)))
|
(doto (History.)
|
||||||
|
(.setToken @page))))
|
||||||
|
|
||||||
(def history nil)
|
(def history nil)
|
||||||
|
|
||||||
|
@ -119,9 +120,9 @@
|
||||||
(evt/listen h hevt/NAVIGATE
|
(evt/listen h hevt/NAVIGATE
|
||||||
(fn [e]
|
(fn [e]
|
||||||
(let [t (.-token e)
|
(let [t (.-token e)
|
||||||
bp (token-base)]
|
tb (token-base)]
|
||||||
(reset! page (if (and bp (== 0 (.indexOf t bp)))
|
(reset! page (if (and tb (== 0 (.indexOf t tb)))
|
||||||
(subs t (count bp))
|
(subs t (count tb))
|
||||||
t)))
|
t)))
|
||||||
(reagent/flush)))
|
(reagent/flush)))
|
||||||
(add-watch page ::history
|
(add-watch page ::history
|
||||||
|
@ -255,9 +256,9 @@
|
||||||
(let [conf (when (exists? js/pageConfig)
|
(let [conf (when (exists? js/pageConfig)
|
||||||
(js->clj js/pageConfig :keywordize-keys true))
|
(js->clj js/pageConfig :keywordize-keys true))
|
||||||
page-name (:page-name conf)]
|
page-name (:page-name conf)]
|
||||||
|
(swap! config merge conf)
|
||||||
(when page-name
|
(when page-name
|
||||||
(set-start-page page-name))
|
(set-start-page page-name))
|
||||||
(swap! config merge conf)
|
|
||||||
(setup-history)
|
(setup-history)
|
||||||
(set! (.-title js/document) (get-title))
|
(set! (.-title js/document) (get-title))
|
||||||
(reagent/render-component (body)
|
(reagent/render-component (body)
|
||||||
|
|
Loading…
Reference in New Issue