iuse when instead of if because there is no else - cl-yag - Common Lisp Yet Another website Generator Err bitreich.org 70
hgit clone git://bitreich.org/cl-yag/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/cl-yag/ URL:git://bitreich.org/cl-yag/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/cl-yag/ bitreich.org 70
1Log /scm/cl-yag/log.gph bitreich.org 70
1Files /scm/cl-yag/files.gph bitreich.org 70
1Refs /scm/cl-yag/refs.gph bitreich.org 70
1Tags /scm/cl-yag/tag bitreich.org 70
1README /scm/cl-yag/file/README.md.gph bitreich.org 70
1LICENSE /scm/cl-yag/file/LICENSE.gph bitreich.org 70
i--- Err bitreich.org 70
1commit b0cd4f627992889230b31f3b414d0cbd16099610 /scm/cl-yag/commit/b0cd4f627992889230b31f3b414d0cbd16099610.gph bitreich.org 70
1parent fb05dcdf99bb18fa6d9fe26569d3cf018c837443 /scm/cl-yag/commit/fb05dcdf99bb18fa6d9fe26569d3cf018c837443.gph bitreich.org 70
hAuthor: Solene Rapenne <solene@dataswamp.org> URL:mailto:solene@dataswamp.org bitreich.org 70
iDate: Fri, 6 May 2016 16:36:06 +0200 Err bitreich.org 70
i Err bitreich.org 70
iuse when instead of if because there is no else Err bitreich.org 70
i Err bitreich.org 70
iDiffstat: Err bitreich.org 70
i M generator.lisp | 15 ++++++++------- Err bitreich.org 70
i Err bitreich.org 70
i1 file changed, 8 insertions(+), 7 deletions(-) Err bitreich.org 70
i--- Err bitreich.org 70
1diff --git a/generator.lisp b/generator.lisp /scm/cl-yag/file/generator.lisp.gph bitreich.org 70
i@@ -67,12 +67,12 @@ Err bitreich.org 70
i (defun articles-by-tag() Err bitreich.org 70
i (let ((tag-list)) Err bitreich.org 70
i (loop for article in *articles* do Err bitreich.org 70
i- (if (getf article :tag nil) ;; we don't want an error if no tag Err bitreich.org 70
i- (loop for tag in (split-str (getf article :tag)) do ;; for each word in tag keyword Err bitreich.org 70
i- (setf (getf tag-list (intern tag "KEYWORD")) ;; we create the keyword is inexistent and add ID to :value Err bitreich.org 70
i- (list Err bitreich.org 70
i- :name tag Err bitreich.org 70
i- :value (push (getf article :id) (getf (getf tag-list (intern tag "KEYWORD")) :value))))))) Err bitreich.org 70
i+ (when (getf article :tag nil) ;; we don't want an error if no tag Err bitreich.org 70
i+ (loop for tag in (split-str (getf article :tag)) do ;; for each word in tag keyword Err bitreich.org 70
i+ (setf (getf tag-list (intern tag "KEYWORD")) ;; we create the keyword is inexistent and add ID to :value Err bitreich.org 70
i+ (list Err bitreich.org 70
i+ :name tag Err bitreich.org 70
i+ :value (push (getf article :id) (getf (getf tag-list (intern tag "KEYWORD")) :value))))))) Err bitreich.org 70
i (loop for i from 1 to (length tag-list) by 2 collect ;; removing the keywords Err bitreich.org 70
i (nth i tag-list)))) Err bitreich.org 70
i Err bitreich.org 70
i@@ -102,7 +102,8 @@ Err bitreich.org 70
i (template "%%Id%%" (getf article :id)) Err bitreich.org 70
i (template "%%Tags%%" (get-tag-list-article article)) Err bitreich.org 70
i (template "%%Text%%" (if (and tiny (member :tiny article)) Err bitreich.org 70
i- (getf article :tiny) (load-file (format nil "data/~d.txt" (getf article :id))))))) Err bitreich.org 70
i+ (getf article :tiny) Err bitreich.org 70
i+ (load-file (format nil "data/~d.txt" (getf article :id))))))) Err bitreich.org 70
i Err bitreich.org 70
i ;; return a html string Err bitreich.org 70
i ;; produce the code of a whole page with title+layout with the parameter as the content Err bitreich.org 70
.
Response:
text/plain