diff --git a/NEWS.md b/NEWS.md index 6fa1655..a662cdc 100644 --- a/NEWS.md +++ b/NEWS.md @@ -11,7 +11,7 @@ * **SITE-BREAKING CHANGE**: Coleslaw now supports user-defined routing. Instead of hard-coding the paths various content types are stored at, they **must** be specified in the configuration file (.coleslawrc). - Just copy the `:routing` key from the [example][single_site.rc] to + Just copy the `:routing` key from the [example][example.rc] to get the old behavior. * **SITE-BREAKING CHANGE**: Coleslaw's multi-site support has changed. Instead of having a single .coleslawrc in the user's home directory @@ -98,4 +98,4 @@ [hacking_guide]: https://github.com/redline6561/coleslaw/blob/master/docs/hacking.md [theming_guide]: https://github.com/redline6561/coleslaw/blob/master/docs/themes.md -[single_site.rc]: https://github.com/redline6561/coleslaw/blob/master/examples/single-site.coleslawrc +[example.rc]: https://github.com/redline6561/coleslaw/blob/master/examples/example.coleslawrc diff --git a/src/documents.lisp b/src/documents.lisp index 1405e69..a7aff98 100644 --- a/src/documents.lisp +++ b/src/documents.lisp @@ -35,10 +35,9 @@ (error "No routing method found for: ~A" class-name))))) (defmethod page-url :around ((document t)) - (let ((result (call-next-method))) - (if (pathname-type result) - (make-pathname :defaults result) - (make-pathname :type "html" :defaults result)))) + (let* ((result (call-next-method)) + (type (or (pathname-type result) "html"))) + (make-pathname :type type :defaults result))) (defgeneric render (document &key &allow-other-keys) (:documentation "Render the given DOCUMENT to HTML."))