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
|
||||
|
||||
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
|
||||
|
||||
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; \
|
||||
( cd $(SITEDIR)/.. && python -m SimpleHTTPServer $(PORT) & ); \
|
||||
lein with-profile $(PROF), cljsbuild auto )
|
||||
|
|
|
@ -132,4 +132,4 @@
|
|||
[demo-component {:comp geometry-example}]])]]))
|
||||
|
||||
(tools/register-page url (fn [] [main])
|
||||
(str "Reagent: " title))
|
||||
(str "Reagent 0.4.0: " title))
|
||||
|
|
|
@ -103,7 +103,8 @@
|
|||
(if (use-html5-history)
|
||||
(doto (Html5History.)
|
||||
(.setUseFragment false))
|
||||
(History.)))
|
||||
(doto (History.)
|
||||
(.setToken @page))))
|
||||
|
||||
(def history nil)
|
||||
|
||||
|
@ -119,9 +120,9 @@
|
|||
(evt/listen h hevt/NAVIGATE
|
||||
(fn [e]
|
||||
(let [t (.-token e)
|
||||
bp (token-base)]
|
||||
(reset! page (if (and bp (== 0 (.indexOf t bp)))
|
||||
(subs t (count bp))
|
||||
tb (token-base)]
|
||||
(reset! page (if (and tb (== 0 (.indexOf t tb)))
|
||||
(subs t (count tb))
|
||||
t)))
|
||||
(reagent/flush)))
|
||||
(add-watch page ::history
|
||||
|
@ -255,9 +256,9 @@
|
|||
(let [conf (when (exists? js/pageConfig)
|
||||
(js->clj js/pageConfig :keywordize-keys true))
|
||||
page-name (:page-name conf)]
|
||||
(swap! config merge conf)
|
||||
(when page-name
|
||||
(set-start-page page-name))
|
||||
(swap! config merge conf)
|
||||
(setup-history)
|
||||
(set! (.-title js/document) (get-title))
|
||||
(reagent/render-component (body)
|
||||
|
|
Loading…
Reference in New Issue