Skip to content

Commit 5c51d88

Browse files
committed
refactor: improve breadcrumb
1 parent fea556e commit 5c51d88

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

src/pug/_partials/breadcrumb.pug

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
1-
// Breadcrumb
2-
nav(aria-label="breadcrumb")
3-
ol.breadcrumb.my-0.ms-2
4-
li.breadcrumb-item Home
5-
li.breadcrumb-item
6-
a(href="#") Admin
7-
li.breadcrumb-item.active Dashboard
8-
1+
mixin breadcrumb(items, last)
2+
// Breadcrumb
3+
nav(aria-label="breadcrumb")
4+
ol.breadcrumb.my-0.ms-2
5+
each item in items
6+
li.breadcrumb-item
7+
// if breadcrumb is single
8+
if (items.length === 1)
9+
span= item
10+
else
11+
a(href="#")= item
12+
13+
if last
14+
li.breadcrumb-item.active
15+
span= last
16+
else

0 commit comments

Comments
 (0)