我正在尝试通过 hunchentoot 和 cl-who 构建个人网站,但在以下代码中出现语义错误:
(defun index ()
(standart-page (:title "~apb")
(dolist (article (articles))
(cl-who:htm
(:ul
(:li (format nil "~a: ~a" (article-date article) (article-title article))))))))
“标准页面”是一个宏:
(defmacro standart-page ((&key title) &body body) `(cl-who:with-html-output-to-string (*standart-output* nil :prologue t :indent t)
(:html :xmlns "http://www.w3.org/1999/xhtml"
:xml\:lang "de"
:lang "de"
(:head
(:title ,title)
(:body
(:div :id "wrapper"
(:div :id "header"
(:h1 "~apb"))
(:div :id "content"
,@body)))))))
“(index)”的评估(在“(articles)”中有一篇测试文章返回:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='de' lang='de'>
<head>
<title>
~apb
</title>
<body>
<div id='wrapper'>
<div id='header'>
<h1>
~apb
</h1>
</div>
<div id='content'>
<ul>
<li>
</li>
</ul>
</div>
</div>
</body>
</head>
</html>
通过查看<li>..</li>
标签,我想知道为什么没有输出。我认为格式功能有问题,但我不知道是什么。