Split body in header an main macros

This commit is contained in:
Marcus Kammer 2024-06-22 14:24:55 +02:00
parent 572959eec7
commit 74ac5c16b7
Signed by: marcuskammer
GPG key ID: C374817BE285268F

View file

@ -153,20 +153,28 @@ Example usage:
,@(loop for url in add-css-urls
collect `(:link :type "text/css"
:rel "stylesheet" :href ,url)))
(:body
(:body ,@body)
(:script :src ,(bs-url-js))
,@(loop for url in add-js-urls
collect `(:script :src ,url)))))
(defmacro body-header (main-heading &body body)
`(spinneret:with-html
(:header
(:div :class "container text-center py-3"
(:a :href "#main-content"
:class "skip-link"
(find-l10n "skip-link" *html-lang* *l10n*)))
,@body
(:h1 ,main-heading))))
(:h1 :class "visually-hidden" ,title)
(defmacro body-main (&optional main-con &body body)
`(spinneret:with-html
(:main :id "main-content"
,@(if main-con (list :class "container") nil) ,@body)
,@(when main-con (list :class "container"))
,@body)))
(:script :src ,(bs-url-js))
,@(loop for url in add-js-urls
collect `(:script :src ,url))))))
(defun remove-special-chars (str)
"Removes all special characters from the string STR except numbers and alphabets.