Calc items-length just one time
This commit is contained in:
parent
df6bc8407e
commit
2f60f80d04
1 changed files with 10 additions and 9 deletions
|
@ -14,12 +14,13 @@ Example usage:
|
|||
\"Home\" \"/\"
|
||||
\"Library\" \"/library\"
|
||||
\"Data\" nil)"
|
||||
(let ((items-length (/ (length items) 2)))
|
||||
`(spinneret:with-html
|
||||
(:nav :class "container"
|
||||
:aria-label "breadcrumb"
|
||||
(:ol :class "breadcrumb"
|
||||
,@(loop for (label url) on items by #'cddr
|
||||
for i from 1
|
||||
collect (if (= i (/ (length items) 2))
|
||||
collect (if (= i items-length)
|
||||
`(:li :class "breadcrumb-item active" :aria-current "page" ,label)
|
||||
`(:li :class "breadcrumb-item" (:a :href ,url ,label))))))))
|
||||
`(:li :class "breadcrumb-item" (:a :href ,url ,label)))))))))
|
||||
|
|
Loading…
Add table
Reference in a new issue