navbar can handle brand-name and brand-url arguments
This commit is contained in:
parent
2bb2a5019a
commit
d56575f066
1 changed files with 3 additions and 9 deletions
|
@ -226,11 +226,7 @@ Example:
|
|||
,(getf navitem :name))))))
|
||||
nil))))))
|
||||
|
||||
(defparameter *brand-name* "My Brand")
|
||||
|
||||
(defparameter *brand-url* "/")
|
||||
|
||||
(defmacro with-navbar (container active-item &rest items)
|
||||
(defmacro with-navbar (container-type brand-name brand-url active-item &rest items)
|
||||
"Creates a Bootstrap navigation bar.
|
||||
|
||||
ACTIVE-ITEM: The key of the currently active item
|
||||
|
@ -239,10 +235,8 @@ ITEMS: A plist of nav items in the form of :key \"url\" pairs"
|
|||
`(spinneret:with-html
|
||||
(:nav :class "navbar navbar-expand-lg bg-body-tertiary mb-5"
|
||||
:aria-label "Main"
|
||||
(:div :class (if ,container
|
||||
(concatenate 'string "container-" ,container)
|
||||
"container")
|
||||
(:a :class "navbar-brand" :href ,*brand-url* ,*brand-name*)
|
||||
(:div :class (format nil "container~@[-~A~]" ,container-type)
|
||||
(:a :class "navbar-brand" :href ,brand-url ,brand-name)
|
||||
(:button :class "navbar-toggler" :type "button"
|
||||
:data-bs-toggle "collapse" :data-bs-target "#navbarNav"
|
||||
:aria-controls "navbarNav" :aria-expanded "false" :aria-label "Toggle navigation"
|
||||
|
|
Loading…
Add table
Reference in a new issue