make start page configurable

This commit is contained in:
jem 2019-01-08 19:59:16 +01:00
parent 4026e23946
commit fad1fcfea5
3 changed files with 6 additions and 3 deletions

View file

@ -28,6 +28,7 @@
;; ; ; ; ; ; ; ; ; ;
{
:content-dir "resources/public/content"
:start-page "README"
;; where content is served from.
:default-locale "en-GB" ;; default language used for messages
:formatters {"vega" smeagol.formatting/process-vega
@ -38,6 +39,5 @@
;; :trace :debug :info :warn :error :fatal
:passwd "resources/passwd"
;; where the password file is stored
:site-title "Smeagol" ;; overall title of the site, used in
:site-title "Smeagol"} ;; overall title of the site, used in
;; page headings
}

View file

@ -125,7 +125,7 @@
(or
(show-sanity-check-error)
(let [params (keywordize-keys (:params request))
page (or (:page params) (util/get-message :default-page-title "Introduction" request))
page (or (:page params) util/start-page (util/get-message :default-page-title "Introduction" request))
file-name (str page ".md")
file-path (cjio/file util/content-dir file-name)
exists? (.exists (clojure.java.io/as-file file-path))]

View file

@ -35,6 +35,9 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(def start-page
(:start-page config))
(def content-dir
(or
(:content-dir config)