fixed error if no tag supplied, customize title of page with article's name - c… | |
git clone git://bitreich.org/cl-yag/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws… | |
Log | |
Files | |
Refs | |
Tags | |
README | |
LICENSE | |
--- | |
commit 7682a4620e7aa93fabcd996fe7450e8f67bf7f37 | |
parent 94f67f290121a55da02ca3440e4ec4899622bc78 | |
Author: solene rapenne <[email protected]> | |
Date: Thu, 19 May 2016 11:07:31 +0200 | |
fixed error if no tag supplied, customize title of page with article's name | |
Diffstat: | |
M generator.lisp | 9 +++++---- | |
1 file changed, 5 insertions(+), 4 deletions(-) | |
--- | |
diff --git a/generator.lisp b/generator.lisp | |
@@ -81,7 +81,7 @@ | |
(strip-quotes | |
(mapcar #'(lambda (item) | |
(prepare "template/one-tag.tpl" (template "%%Name%%" item))) | |
- (split-str (getf article :tag ""))))) | |
+ (split-str (getf article :tag))))) | |
;; generates the html of the whole list of tags | |
(defun get-tag-list() | |
@@ -107,9 +107,9 @@ | |
;; return a html string | |
;; produce the code of a whole page with title+layout with the parameter as th… | |
-(defun generate-layout(body) | |
+(defun generate-layout(body &optional &key (title nil)) | |
(prepare "template/layout.tpl" | |
- (template "%%Title%%" (getf *config* :title)) | |
+ (template "%%Title%%" (if title title (getf *config* :title))) | |
(template "%%Tags%%" (get-tag-list)) | |
(template "%%Body%%" body) | |
output)) | |
@@ -159,7 +159,8 @@ | |
;; produce each article file | |
(dolist (article *articles*) | |
(generate (format nil "article-~d.html" (getf article :id)) | |
- (create-article article :tiny nil))) | |
+ (create-article article :tiny nil) | |
+ :title (concatenate 'string (getf *config* :title) " : " (getf a… | |
;; produce index file for each tag | |
(loop for tag in (articles-by-tag) do |