|
|
|
@ -39,7 +39,8 @@
|
|
|
|
|
;; Execute package definition |
|
|
|
|
|
|
|
|
|
(defpackage ritherdon-archive.djula |
|
|
|
|
(:use #:cl) |
|
|
|
|
(:use #:cl |
|
|
|
|
#:storage) |
|
|
|
|
(:import-from #:files |
|
|
|
|
#:storage-file) |
|
|
|
|
(:import-from #:ritherdon-archive.config |
|
|
|
@ -50,6 +51,10 @@
|
|
|
|
|
(:import-from #:caveman2 |
|
|
|
|
#:url-for)) |
|
|
|
|
|
|
|
|
|
;; Added 'in-package' line after default Caveman2 set-up. Needed for custom |
|
|
|
|
;; functions. Not part of Caveman2 set-up. |
|
|
|
|
(in-package #:ritherdon-archive.djula) |
|
|
|
|
|
|
|
|
|
(setf djula:*djula-execute-package* (find-package :ritherdon-archive.djula)) |
|
|
|
|
|
|
|
|
|
;; Custom filters and template code added below... |
|
|
|
@ -83,3 +88,8 @@
|
|
|
|
|
((str:contains? "zip" (files::file-type-of file) :ignore-case t) |
|
|
|
|
(format nil "/images/icons/archive.png")) |
|
|
|
|
(t (format nil "/images/icons/file.png")))) |
|
|
|
|
|
|
|
|
|
(defun insert-snippet (snippet-name) |
|
|
|
|
(if (storage:file-exists-p "" "snippets" snippet-name) |
|
|
|
|
(format nil "~a" (storage:open-text-file "" "snippets" snippet-name)) |
|
|
|
|
(format nil "<!-- ~a not found -->" snippet-name))) |
|
|
|
|