Merge pull request #39 from DomainDrivenArchitecture/Configurable_intro_page

make start page configurable
This commit is contained in:
Simon Brooke 2019-01-19 16:41:47 +00:00 committed by GitHub
commit b1eeecde1d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 3 deletions

View file

@ -28,6 +28,7 @@
;; ; ; ; ; ; ; ; ; ; ;; ; ; ; ; ; ; ; ; ;
{ {
:content-dir "resources/public/content" :content-dir "resources/public/content"
:start-page "Introduction"
;; where content is served from. ;; where content is served from.
:default-locale "en-GB" ;; default language used for messages :default-locale "en-GB" ;; default language used for messages
:formatters {"vega" smeagol.formatting/process-vega :formatters {"vega" smeagol.formatting/process-vega
@ -38,6 +39,5 @@
;; :trace :debug :info :warn :error :fatal ;; :trace :debug :info :warn :error :fatal
:passwd "resources/passwd" :passwd "resources/passwd"
;; where the password file is stored ;; 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 ;; page headings
}

View file

@ -125,7 +125,7 @@
(or (or
(show-sanity-check-error) (show-sanity-check-error)
(let [params (keywordize-keys (:params request)) (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-name (str page ".md")
file-path (cjio/file util/content-dir file-name) file-path (cjio/file util/content-dir file-name)
exists? (.exists (clojure.java.io/as-file file-path))] exists? (.exists (clojure.java.io/as-file file-path))]

View file

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