commit c50345cdbd29f5e9c0a91ca3666e4ff93590aba6
Solene Rapenne <solene@perso.pw>
2017-11-17 14:51:35 +0000
rename template to templates
generator.lisp | 14 +++++++-------
{template => templates}/article.tpl | 0
{template => templates}/gopher_head.tpl | 0
{template => templates}/layout.tpl | 0
{template => templates}/one-tag.tpl | 0
{template => templates}/rss-item.tpl | 0
{template => templates}/rss.tpl | 0
7 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/generator.lisp b/generator.lisp
index c99042d..72d3e99 100644
--- a/generator.lisp
+++ b/generator.lisp
@@ -84,14 +84,14 @@
(defun get-tag-list-article(&optional article)
(strip-quotes
(mapcar #'(lambda (item)
- (prepare "template/one-tag.tpl" (template "%%Name%%" item)))
+ (prepare "templates/one-tag.tpl" (template "%%Name%%" item)))
(split-str (getf article :tag)))))
;; generates the html of the whole list of tags
(defun get-tag-list()
(strip-quotes
(mapcar #'(lambda (item)
- (prepare "template/one-tag.tpl"
+ (prepare "templates/one-tag.tpl"
(template "%%Name%%" (getf item :name))))
(articles-by-tag))))
@@ -99,7 +99,7 @@
;; generates the html of one only article
;; this is called in a loop to produce the homepage
(defun create-article(article &optional &key (tiny t) (no-text nil))
- (prepare "template/article.tpl"
+ (prepare "templates/article.tpl"
(template "%%Author%%" (getf article :author (getf *config* :webmaster)))
(template "%%Date%%" (getf article :date))
(template "%%Title%%" (getf article :title))
@@ -114,7 +114,7 @@
;; return a html string
;; produce the code of a whole page with title+layout with the parameter as the content
(defun generate-layout(body &optional &key (title nil))
- (prepare "template/layout.tpl"
+ (prepare "templates/layout.tpl"
(template "%%Title%%" (if title title (getf *config* :title)))
(template "%%Tags%%" (get-tag-list))
(template "%%Body%%" body)
@@ -140,7 +140,7 @@
(loop for article in *articles*
for i from 1 to (if (> (length *articles*) (getf *config* :rss-item-number)) (getf *config* :rss-item-number) (length *articles*))
collect
- (prepare "template/rss-item.tpl"
+ (prepare "templates/rss-item.tpl"
(template "%%Title%%" (getf article :title))
(template "%%Description%%" (load-file (format nil "temp/data/~d.html" (getf article :id))))
(template "%%Url%%"
@@ -150,7 +150,7 @@
;; Generate the rss xml data
(defun generate-rss()
- (prepare "template/rss.tpl"
+ (prepare "templates/rss.tpl"
(template "%%Description%%" (getf *config* :description))
(template "%%Title%%" (getf *config* :title))
(template "%%Url%%" (getf *config* :url))
@@ -183,7 +183,7 @@
;; produce the gophermap file
(save-file "output/gopher/gophermap"
- (let ((output (load-file "template/gopher_head.tpl")))
+ (let ((output (load-file "templates/gopher_head.tpl")))
(dolist (article *articles*)
(setf output
(string
diff --git a/template/article.tpl b/templates/article.tpl
similarity index 100%
rename from template/article.tpl
rename to templates/article.tpl
diff --git a/template/gopher_head.tpl b/templates/gopher_head.tpl
similarity index 100%
rename from template/gopher_head.tpl
rename to templates/gopher_head.tpl
diff --git a/template/layout.tpl b/templates/layout.tpl
similarity index 100%
rename from template/layout.tpl
rename to templates/layout.tpl
diff --git a/template/one-tag.tpl b/templates/one-tag.tpl
similarity index 100%
rename from template/one-tag.tpl
rename to templates/one-tag.tpl
diff --git a/template/rss-item.tpl b/templates/rss-item.tpl
similarity index 100%
rename from template/rss-item.tpl
rename to templates/rss-item.tpl
diff --git a/template/rss.tpl b/templates/rss.tpl
similarity index 100%
rename from template/rss.tpl
rename to templates/rss.tpl