-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I believe, everything you want except layouts is already available from Spinneret #1
Comments
Hello! Big fan of yours! Maybe I was holding it wrong but composition in spinneret was not as seamless as I expected and variable interpolation was not working. Maybe I was doing something wrong. |
Hmmm, trying it again now it mostly works and composes as I expected, I have no idea what I tried then I could create a spinneret layouts indeed :) |
Actually, what you are trying to do with layouts can be accomplished with a macro. Here is how I've rewrote the code from your README: (defmacro main-layout ((&key title) &body body)
`(spinneret:with-html
(:html
(:head
(:script :src "https://whatever")
(:title ,title))
(:body
,@body))))
(defun main-func ()
(main-layout (:title "Hello World!")
(:div "Hello World"))) And when I run it, I'm getting this result:
But for my projects based on Reblocks framework, I'm using generic functions for template composition. For example, here is the main "layout" for the page, defined for any Reblocks app. It calls render-body generic function. And in Ultralisp I define a method for it to show the real page content. The same way, widgets (a smaller pieces of the page) can define their own html in their render methods and these blocks can nest each other. For example here, I'm wrapping each page widget with the "frame" widget by calling |
What about just adding layouts feature on top of Spinneret as a separate spinneret-layouts system?
The text was updated successfully, but these errors were encountered: