Answer the question
In order to leave comments, you need to log in
How to issue cards through Pug?
I work with pug and bootstrap4, according to the technical task, I need to make sure that the card is laid out once and then called 6 times.
at first I thought what should be done on mixins, but the technical specification clearly states that the card should be laid out once .
I decided that it was worth making a separate page, making one card in it and inserting it into the pag 6 times using include index.html
.
Tell me, who would do it?
Answer the question
In order to leave comments, you need to log in
implemented in this way
- var gmi = "../img/team-image.png"
mixin teams(worker)
div.myCard
img(class="workers" width="220px", src=gmi, alt="teams")
h3(class="h3-teams")= worker.h3
p(class="p-teams")= worker.p
each item in [{h3: "SEMF UCUK", p:"CEO & FOUNDER"}, {h3: "DIK ADALIN", p:"ENGINEERING"}, {h3: "JENG KOL", p:"DESIGNER"}, {h3: "PET ROMAK", p: "MARKETING"}]
+teams(item)
https://pugjs.org/language/iteration.html
via each
-
var items = [{
img: '',
title: 'semf ucuk',
description: ""
},
{
img: '',
title: 'semf ucuk',
description: ""
},
{
img: '',
title: 'dik',
description: ""
},
{
img: '',
title: 'jeng',
description: ""
},
{
img: '',
title: 'pet',
description: ""
}]
each item in items
div.card
.title!=item.title
.desc!=item.description
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question