-
Notifications
You must be signed in to change notification settings - Fork 57
/
config.lisp
62 lines (42 loc) · 1.83 KB
/
config.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
;;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: LLTHW; Base: 10 -*-
;;;; file: config.lisp
;;;; Copyright (c) 2012--2015 "the Phoeron" Colin J.E. Lupton <//thephoeron.com>
;;;; See LICENSE for additional information.
(in-package :llthw)
;; Project Directory and Sub-Directory variables
(defparameter *default-dir*
(pathname (directory-namestring #.(or *compile-file-truename*
*load-truename*))))
(defparameter *static-dir* (merge-pathnames "static/" *default-dir*))
(defparameter *the-book-dir* (merge-pathnames "book/" *default-dir*))
(defparameter *res-dir* (merge-pathnames "resources/" *default-dir*))
(defparameter *ref-dir* (merge-pathnames "reference/" *default-dir*))
;; list of book files, may be deprecated
(defparameter *book-files* (directory (merge-pathnames "*.md" *the-book-dir*)))
;; Define hunchentoot log files
(defparameter *acc-log* (merge-pathnames "log/access.log" *default-dir*))
(defparameter *msg-log* (merge-pathnames "log/message.log" *default-dir*))
;; Sanity check, ensure subdirectories have been created
(ensure-directories-exist *acc-log*)
;; LLTHW Acceptor
(defparameter *acc* nil)
;; Dispatch Table -- only need easy handlers
(setf hunchentoot:*dispatch-table*
(list 'hunchentoot:dispatch-easy-handlers))
;; Library settings
(setf ;; for utf-8
hunchentoot:*default-content-type* "text/html; charset=utf-8"
;; for debug ; hunchentoot:*catch-errors-p* t
(cl-who:html-mode) :html5
ps:*js-string-delimiter* #\"
3bmd:*smart-quotes* t
3bmd-code-blocks:*code-blocks* t
3bmd-definition-lists:*definition-lists* t
3bmd-tables:*tables* t
3bmd-code-blocks:*code-blocks-default-colorize* :common-lisp)
;; Server Information
(defun server-type ()
"Hunchentoot")
(defun server-version ()
hunchentoot::*hunchentoot-version*)
;; EOF