+
+
-
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
+
-
+
-
+
+
+
-
-
+
+
+
+
+
\ No newline at end of file
diff --git a/src/smeagol/extensions/photoswipe.clj b/src/smeagol/extensions/photoswipe.clj
index eef329e..6053e2a 100644
--- a/src/smeagol/extensions/photoswipe.clj
+++ b/src/smeagol/extensions/photoswipe.clj
@@ -9,6 +9,8 @@
[instaparse.core :as insta]
[me.raynes.fs :as fs]
[noir.io :as io]
+ [selmer.parser :refer [render]]
+ [selmer.util :refer [without-escaping]]
[smeagol.configuration :refer [config]]
[smeagol.extensions.utils :refer [resource-url-or-data->data uploaded?]]
[smeagol.util :refer [content-dir upload-dir]]
@@ -41,31 +43,11 @@
"Process a specification for a photoswipe gallery, using a JSON
specification based on that documented on the Photoswipe website."
[^String spec ^Integer index]
- (str
- "
-
\n"
+ (without-escaping
+ (render
(slurp
- (str (io/resource-path) "html-includes/photoswipe-boilerplate.html"))
- "
-
-
-
"))
+ (str (io/resource-path) "html-includes/photoswipe-boilerplate.html"))
+ {:spec spec :index index})))
(def simple-grammar
diff --git a/src/smeagol/history.clj b/src/smeagol/history.clj
index 81b546e..fab6dee 100644
--- a/src/smeagol/history.clj
+++ b/src/smeagol/history.clj
@@ -54,9 +54,9 @@
(git/load-repo git-directory-path)
(catch java.io.FileNotFoundException _
(log/info "Initialising Git repository at" git-directory-path)
- (git/git-init git-directory-path)
+ (git/git-init :dir git-directory-path)
(let [repo (git/load-repo git-directory-path)]
- (git/git-add-and-commit repo "Initial commit")
+ (git/git-commit repo "Initial commit")
repo))))
diff --git a/src/smeagol/routes/wiki.clj b/src/smeagol/routes/wiki.clj
index fa2b6f5..0944f5c 100644
--- a/src/smeagol/routes/wiki.clj
+++ b/src/smeagol/routes/wiki.clj
@@ -72,7 +72,7 @@
(log/info (format "Saving %s's changes ('%s') to %s in file '%s'" user summary page file-path))
(spit file-path source-text)
(git/git-add git-repo file-name)
- (git/git-commit git-repo summary {:name user :email email})
+ (git/git-commit git-repo summary :name user :email email)
(response/redirect
(str
"/wiki?page="
diff --git a/src/smeagol/util.clj b/src/smeagol/util.clj
index 60a7355..5cccf51 100644
--- a/src/smeagol/util.clj
+++ b/src/smeagol/util.clj
@@ -156,8 +156,10 @@
(defn get-servlet-context-path
+ "Return the servlet context path, if we're running as a servlet; if
+ not, return `nil`."
[request]
- (if-let [context (:servlet-context request)]
+ (when-let [context (:servlet-context request)]
;; If we're not inside a serlvet environment (for
;; example when using mock requests), then
;; .getContextPath might not exist