From 52b32f459b068edd21f0675703a1e8fca6060a2c Mon Sep 17 00:00:00 2001 From: Brit Butler Date: Wed, 7 May 2014 17:51:49 -0400 Subject: [PATCH] Add support for looking up content by relative path. --- src/content.lisp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/content.lisp b/src/content.lisp index c81e1de..dccb0b3 100644 --- a/src/content.lisp +++ b/src/content.lisp @@ -79,6 +79,10 @@ "Sort CONTENT in reverse chronological order." (sort content #'string> :key #'content-date)) +(defun find-content-by-path (path) + "Find the CONTENT corresponding to the file at PATH." + (find path (find-all 'content) :key #'content-file :test #'string=)) + (defgeneric render-text (text format) (:documentation "Render TEXT of the given FORMAT to HTML for display.") (:method (text (format (eql :html)))