Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make repo url configurable in preparation for move to the github orga…

  • Loading branch information...
commit 42a9815de638fd312fa6f9101e30054ea228384d 1 parent 1860e15
@amalloy amalloy authored
View
1  config.clj
@@ -7,4 +7,5 @@
:problem-submission true
:advanced-user-count 50
:pass ""
+ :repo-url "https://github.com/4clojure/4clojure"
:golfing-active true}
View
4 src/foreclojure/config.clj
@@ -5,3 +5,7 @@
(def config-file (file (System/getProperty "user.dir") "config.clj"))
(def config (safely read-config config-file))
+
+;; Defs both for convenience and compile-time verification of simple settings
+(def repo-url (or (:repo-url config)
+ (throw (Exception. "config.clj needs a :repo-url key"))))
View
3  src/foreclojure/static.clj
@@ -1,6 +1,7 @@
(ns foreclojure.static
(:use [compojure.core :only [defroutes GET]]
[foreclojure.problems :only [total-solved]]
+ [foreclojure.config :only [repo-url]]
[foreclojure.utils :only [def-page]]))
(def df
@@ -21,7 +22,7 @@
[:div
[:h3 "Is this site written in Clojure?"]
"Absolutely! This site was created using a variety of open source Clojure (and Java) libraries. In fact, the "
- [:a {:href "https://github.com/dbyrne/4clojure"} "code for this site"]
+ [:a {:href repo-url} "code for this site"]
" is itself open source. Once you've mastered the language, feel free to contribute something back to the community."]
[:div
[:h3 "So wait, I can't buy cheap real estate here?"]
View
2  src/foreclojure/users.clj
@@ -40,7 +40,7 @@
(def-page users-page []
[:div
[:span.contributor "*"] " "
- (link-to "https://github.com/dbyrne/4clojure" "4clojure contributor")]
+ (link-to (:repo-url config) "4clojure contributor")]
[:br]
[:table#user-table.my-table
[:thead
View
3  src/foreclojure/version.clj
@@ -1,5 +1,6 @@
(ns foreclojure.version
(:use [foreclojure.utils :only [def-page]]
+ [foreclojure.config :only [repo-url]]
[compojure.core :only [defroutes GET]]
[clojure.java.shell :only [sh]]))
@@ -11,7 +12,7 @@
(def-page version []
(if sha
[:p "SHA: "
- [:a {:href (str "http://github.com/dbyrne/4clojure/commit/" sha)} sha]]
+ [:a {:href (str repo-url "/commit/" sha)} sha]]
[:p "No git repository found"]))
(defroutes version-routes
Please sign in to comment.
Something went wrong with that request. Please try again.