Closed defaultxr closed 2 years ago
I realized I was thinking about this the wrong way; block of course only returns its last item. So the solution is to define template like so:
(defmacro template ((&key title) &body body)
`(h (html
(head
(title ,title))
(body
(apply 'main
(block nil
(list ,@body)))))))
This seems to work just fine. Sorry for the noise.
Hi. Thanks for Flute, so far it's definitely the least horrible CL HTML generation system I've used.
I'm trying to define a "template" macro for a site I'm developing. The template looks something like this:
Unfortunately, this doesn't seem to work as expected; when I try the following in a REPL
I get this output:
Notice how the
h1
andh2
are both missing from the output.I've tried multiple different solutions to get this to work, including adding a few
nil
s inside theblock
to "pad it out" in case it was just eating the first few items, but nothing seems to help; I can't getblock
to behave as expected.Is there some way of getting this to work?