Whoops. Misc typo and thinko fixes. Bump version to 0.5. We're useful now!
This commit is contained in:
parent
377f1143ec
commit
023004269a
6 changed files with 33 additions and 10 deletions
|
@ -1,7 +1,7 @@
|
|||
(defsystem #:coleslaw
|
||||
:name "coleslaw-core"
|
||||
:description "Flexible Lisp Blogware"
|
||||
:version "0.4"
|
||||
:version "0.5"
|
||||
:license "BSD"
|
||||
:author "Brit Butler <redline6561@gmail.com>"
|
||||
:pathname "src/"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
(:author "Brit Butler"
|
||||
:domain "http://blog.redlinernotes.com"
|
||||
:license "CC-BY-SA"
|
||||
:plugins nil
|
||||
:plugins (markdown mathjax)
|
||||
:repo "/home/redline/projects/coleslaw/ignore/input/"
|
||||
:sitenav ""
|
||||
:title "Improved Means for Achieving Deteriorated Ends"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
(eval-when (:compile-toplevel)
|
||||
(eval-when (:compile-toplevel :load-toplevel)
|
||||
(ql:quickload '(3bmd 3bmd-ext-code-blocks)))
|
||||
|
||||
(defpackage :coleslaw-md
|
||||
|
@ -7,6 +7,6 @@
|
|||
(in-package :coleslaw-md)
|
||||
|
||||
(defmethod render-content (text (format (eql :md)))
|
||||
(let ((3mbd-code-blocks:*code-blocks* t))
|
||||
(let ((3bmd-code-blocks:*code-blocks* t))
|
||||
(with-output-to-string (str)
|
||||
(3bmd:parse-string-and-print-to-stream text str))))
|
||||
|
|
|
@ -10,8 +10,4 @@
|
|||
src=\"http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML\">
|
||||
</script>")
|
||||
|
||||
(defmethod enable ()
|
||||
(coleslaw::add-injection *mathjax-header* :head))
|
||||
|
||||
(defmethod disable ()
|
||||
(coleslaw::remove-injection *mathjax-header* :head))
|
||||
(coleslaw:add-injection *mathjax-header* :head)
|
||||
|
|
|
@ -18,4 +18,5 @@
|
|||
(defun load-config (&optional (dir (user-homedir-pathname)))
|
||||
"Load the coleslaw configuration from DIR/.coleslawrc. DIR is ~ by default."
|
||||
(with-open-file (in (merge-pathnames ".coleslawrc" dir))
|
||||
(setf *config* (apply #'make-instance 'blog (read in)))))
|
||||
(setf *config* (apply #'make-instance 'blog (read in))))
|
||||
(load-plugins (plugins *config*)))
|
||||
|
|
26
src/util.lisp
Normal file
26
src/util.lisp
Normal file
|
@ -0,0 +1,26 @@
|
|||
(in-package :coleslaw)
|
||||
|
||||
(defun app-path (path &rest args)
|
||||
"Take a relative PATH and return the corresponding pathname beneath coleslaw.
|
||||
If ARGS is provided, use (apply 'format nil PATH ARGS) as the value of PATH."
|
||||
(merge-pathnames (apply 'format nil path args) coleslaw-conf:*basedir*))
|
||||
|
||||
(defun to-pathname (file &optional (parent coleslaw-conf:*basedir*))
|
||||
"Convert an iolib file-path back to a pathname."
|
||||
(merge-pathnames (file-path-namestring file) parent))
|
||||
|
||||
(defun read-symlink (path)
|
||||
"A trivial wrapper over iolib.os that returns the pathname in the symlink PATH."
|
||||
(to-pathname (iolib.os:read-symlink path)))
|
||||
|
||||
(defmacro do-files ((var path &optional extension) &body body)
|
||||
"For each file under PATH, run BODY. If EXTENSION is provided, only run BODY
|
||||
on files that match the given extension."
|
||||
(alexandria:with-gensyms (ext)
|
||||
`(mapcar (lambda (,var)
|
||||
,@(if extension
|
||||
`((let ((,ext (pathname-type ,var)))
|
||||
(when (and ,ext (string= ,ext ,extension))
|
||||
,@body)))
|
||||
`,body))
|
||||
(list-directory ,path))))
|
Loading…
Add table
Reference in a new issue