Flexible Lisp Blogware. Fork for personal use. Mirrored from https://github.com/kingcons/coleslaw originally.

config.lisp 966B

123456789101112131415161718192021
  1. (in-package :coleslaw)
  2. (defclass blog ()
  3. ((author :initarg :author :initform "" :accessor author)
  4. (domain :initarg :domain :initform "" :accessor domain)
  5. (license :initarg :license :initform "CC-BY-SA" :accessor license)
  6. (plugins :initarg :plugins :initform '() :accessor plugins)
  7. (repo :initarg :repo :initform #p"/" :accessor repo)
  8. (sitenav :initarg :sitenav :initform "" :accessor sitenav)
  9. (staging :initarg :staging :initform #p"/tmp/coleslaw/" :accessor staging)
  10. (title :initarg :title :initform "" :accessor title)
  11. (theme :initarg :theme :initform "hyde" :accessor theme)))
  12. (defparameter *config* nil
  13. "A variable to store the blog configuration and plugin settings.")
  14. (defun load-config (&optional (dir (user-homedir-pathname)))
  15. "Load the coleslaw configuration from DIR/.coleslawrc. DIR is ~ by default."
  16. (with-open-file (in (merge-pathnames ".coleslawrc" dir))
  17. (setf *config* (apply #'make-instance 'blog (read in)))))