mirror of
https://github.com/journeyman-cc/smeagol.git
synced 2026-04-12 18:05:06 +00:00
WHOOPS! Introduced bugs when I was supposed just to be documenting.
This commit is contained in:
parent
b2ee34bd8e
commit
a775ef7b83
2 changed files with 38 additions and 38 deletions
|
|
@ -106,46 +106,46 @@
|
||||||
{:from :smeagol-site-title :to :site-title}))
|
{:from :smeagol-site-title :to :site-title}))
|
||||||
|
|
||||||
|
|
||||||
(defn- build-config
|
(def build-config
|
||||||
"The actual configuration, as a map. The idea here is that the config
|
"The actual configuration, as a map. The idea here is that the config
|
||||||
file is read (if it is specified and present), but that individual
|
file is read (if it is specified and present), but that individual
|
||||||
values can be overridden by environment variables."
|
values can be overridden by environment variables."
|
||||||
[]
|
(memoize (fn []
|
||||||
(try
|
(try
|
||||||
(log/info (str "Reading configuration from " config-file-path))
|
(log/info (str "Reading configuration from " config-file-path))
|
||||||
(let [file-contents (try
|
(let [file-contents (try
|
||||||
(read-string (slurp config-file-path))
|
(read-string (slurp config-file-path))
|
||||||
(catch Exception x
|
(catch Exception x
|
||||||
(log/error
|
(log/error
|
||||||
(str
|
(str
|
||||||
"Failed to read configuration from "
|
"Failed to read configuration from "
|
||||||
config-file-path
|
config-file-path
|
||||||
" because: "
|
" because: "
|
||||||
(type x)
|
(type x)
|
||||||
"; "
|
"; "
|
||||||
(.getMessage x)))
|
(.getMessage x)))
|
||||||
{}))
|
{}))
|
||||||
config (merge
|
config (merge
|
||||||
file-contents
|
file-contents
|
||||||
(transform-map
|
(transform-map
|
||||||
(from-env-vars
|
(from-env-vars
|
||||||
:smeagol-content-dir
|
:smeagol-content-dir
|
||||||
:smeagol-default-locale
|
:smeagol-default-locale
|
||||||
:smeagol-formatters
|
:smeagol-formatters
|
||||||
:smeagol-js-from
|
:smeagol-js-from
|
||||||
:smeagol-log-level
|
:smeagol-log-level
|
||||||
:smeagol-passwd
|
:smeagol-passwd
|
||||||
:smeagol-site-title)
|
:smeagol-site-title)
|
||||||
config-env-transforms))]
|
config-env-transforms))]
|
||||||
(if (env :dev)
|
(if (env :dev)
|
||||||
(log/debug
|
(log/debug
|
||||||
"Loaded configuration\n"
|
"Loaded configuration\n"
|
||||||
(with-out-str (clojure.pprint/pprint config))))
|
(with-out-str (clojure.pprint/pprint config))))
|
||||||
config)
|
config)
|
||||||
(catch Exception any
|
(catch Exception any
|
||||||
(log/error any "Could not load configuration")
|
(log/error any "Could not load configuration")
|
||||||
{})))
|
{})))))
|
||||||
|
|
||||||
(def config
|
(def config
|
||||||
"The actual configuration, as a map."
|
"The actual configuration, as a map."
|
||||||
(memoize build-config))
|
(build-config))
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@
|
||||||
(declare process-text)
|
(declare process-text)
|
||||||
|
|
||||||
|
|
||||||
(defn- process-backticks
|
(defn process-backticks
|
||||||
"Effectively, escape the backticks surrounding this `text`, by protecting them
|
"Effectively, escape the backticks surrounding this `text`, by protecting them
|
||||||
from the `process-text` filter.
|
from the `process-text` filter.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue