use when instead of if because there is no else - cl-yag - Common Lisp Yet Anot… | |
git clone git://bitreich.org/cl-yag/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws… | |
Log | |
Files | |
Refs | |
Tags | |
README | |
LICENSE | |
--- | |
commit b0cd4f627992889230b31f3b414d0cbd16099610 | |
parent fb05dcdf99bb18fa6d9fe26569d3cf018c837443 | |
Author: Solene Rapenne <[email protected]> | |
Date: Fri, 6 May 2016 16:36:06 +0200 | |
use when instead of if because there is no else | |
Diffstat: | |
M generator.lisp | 15 ++++++++------- | |
1 file changed, 8 insertions(+), 7 deletions(-) | |
--- | |
diff --git a/generator.lisp b/generator.lisp | |
@@ -67,12 +67,12 @@ | |
(defun articles-by-tag() | |
(let ((tag-list)) | |
(loop for article in *articles* do | |
- (if (getf article :tag nil) ;; we don't want an error if no tag | |
- (loop for tag in (split-str (getf article :tag)) do ;; for each … | |
- (setf (getf tag-list (intern tag "KEYWORD")) ;; we create … | |
- (list | |
- :name tag | |
- :value (push (getf article :id) (getf (getf tag-lis… | |
+ (when (getf article :tag nil) ;; we don't want an error if no tag | |
+ (loop for tag in (split-str (getf article :tag)) do ;; for each wo… | |
+ (setf (getf tag-list (intern tag "KEYWORD")) ;; we create th… | |
+ (list | |
+ :name tag | |
+ :value (push (getf article :id) (getf (getf tag-list … | |
(loop for i from 1 to (length tag-list) by 2 collect ;; removing the keywo… | |
(nth i tag-list)))) | |
@@ -102,7 +102,8 @@ | |
(template "%%Id%%" (getf article :id)) | |
(template "%%Tags%%" (get-tag-list-article article)) | |
(template "%%Text%%" (if (and tiny (member :tiny article)) | |
- (getf article :tiny) (load-file (format ni… | |
+ (getf article :tiny) | |
+ (load-file (format nil "data/~d.txt" (getf a… | |
;; return a html string | |
;; produce the code of a whole page with title+layout with the parameter as th… |