ifix formatting - 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 d5537d30940cbeef0a60808bd835835a11ef4beb /scm/cl-yag/commit/d5537d30940cbeef0a60808bd835835a11ef4beb.gph bitreich.org 70 1parent a651b504887429c23aed643787dc55d10f1d501d /scm/cl-yag/commit/a651b504887429c23aed643787dc55d10f1d501d.gph bitreich.org 70 hAuthor: Solene Rapenne URL:mailto:solene@perso.pw bitreich.org 70 iDate: Fri, 3 Nov 2017 13:08:48 +0000 Err bitreich.org 70 i Err bitreich.org 70 ifix formatting Err bitreich.org 70 i Err bitreich.org 70 iDiffstat: Err bitreich.org 70 i M generator.lisp | 26 +++++++++++++------------- Err bitreich.org 70 i Err bitreich.org 70 i1 file changed, 13 insertions(+), 13 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@@ -23,7 +23,7 @@ Err bitreich.org 70 i (find y x :test #'string=))))) Err bitreich.org 70 i (if n Err bitreich.org 70 i (split-str-1 (subseq string 0 n) separator (cons (subseq string (1+ n)) r)) Err bitreich.org 70 i- (cons string r)))) Err bitreich.org 70 i+ (cons string r)))) Err bitreich.org 70 i (defun split-str (string &optional (separator " ")) Err bitreich.org 70 i (split-str-1 string separator)) Err bitreich.org 70 i Err bitreich.org 70 i@@ -48,7 +48,7 @@ Err bitreich.org 70 i ;; save a string in a file Err bitreich.org 70 i (defun save-file(path data) Err bitreich.org 70 i (with-open-file (stream path :direction :output :if-exists :supersede) Err bitreich.org 70 i- (format stream data))) Err bitreich.org 70 i+ (format stream data))) Err bitreich.org 70 i Err bitreich.org 70 i ;; simplify the str replace work Err bitreich.org 70 i (defmacro template(before &body after) Err bitreich.org 70 i@@ -79,7 +79,7 @@ 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+ Err bitreich.org 70 i ;; generates the html of the list of tags for an article Err bitreich.org 70 i (defun get-tag-list-article(&optional article) Err bitreich.org 70 i (strip-quotes Err bitreich.org 70 i@@ -94,22 +94,22 @@ Err bitreich.org 70 i (prepare "template/one-tag.tpl" Err bitreich.org 70 i (template "%%Name%%" (getf item :name)))) Err bitreich.org 70 i (articles-by-tag)))) Err bitreich.org 70 i- Err bitreich.org 70 i+ Err bitreich.org 70 i Err bitreich.org 70 i ;; generates the html of one only article Err bitreich.org 70 i ;; this is called in a loop to produce the homepage Err bitreich.org 70 i (defun create-article(article &optional &key (tiny t) (no-text nil)) Err bitreich.org 70 i (prepare "template/article.tpl" Err bitreich.org 70 i (template "%%Author%%" (getf article :author (getf *config* :webmaster))) Err bitreich.org 70 i- (template "%%Date%%" (getf article :date)) Err bitreich.org 70 i- (template "%%Title%%" (getf article :title)) 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 no-text Err bitreich.org 70 i- "" Err bitreich.org 70 i- (if (and tiny (member :tiny article)) Err bitreich.org 70 i- (getf article :tiny) Err bitreich.org 70 i- (load-file (format nil "temp/data/~d.html" (getf article :id)))))))) Err bitreich.org 70 i+ (template "%%Date%%" (getf article :date)) Err bitreich.org 70 i+ (template "%%Title%%" (getf article :title)) 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 no-text Err bitreich.org 70 i+ "" Err bitreich.org 70 i+ (if (and tiny (member :tiny article)) Err bitreich.org 70 i+ (getf article :tiny) Err bitreich.org 70 i+ (load-file (format nil "temp/data/~d.html" (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 .