Split body in header an main macros
This commit is contained in:
parent
572959eec7
commit
74ac5c16b7
1 changed files with 19 additions and 11 deletions
|
@ -153,20 +153,28 @@ Example usage:
|
||||||
,@(loop for url in add-css-urls
|
,@(loop for url in add-css-urls
|
||||||
collect `(:link :type "text/css"
|
collect `(:link :type "text/css"
|
||||||
:rel "stylesheet" :href ,url)))
|
: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"
|
(:div :class "container text-center py-3"
|
||||||
(:a :href "#main-content"
|
(:a :href "#main-content"
|
||||||
:class "skip-link"
|
:class "skip-link"
|
||||||
(find-l10n "skip-link" *html-lang* *l10n*)))
|
(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"
|
(: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)
|
(defun remove-special-chars (str)
|
||||||
"Removes all special characters from the string STR except numbers and alphabets.
|
"Removes all special characters from the string STR except numbers and alphabets.
|
||||||
|
|
Loading…
Add table
Reference in a new issue