piekarnikgosipl/html/wyroby_ciasta.templ

29 lines
536 B
Text

package html
import "piekarnikgosi/types"
templ card(product types.Product) {
<div class="card">
<div>
@AvifImage("wyroby/"+product.Image+".avif", product.Name, true, false)
</div>
<div>
<h3>{ product.Name }</h3>
<span>{ product.Price }zł</span>
<p>{ product.Description }</p>
</div>
</div>
}
templ Wyroby(products []types.Product, page string) {
@layout("wyroby") {
<main>
@wyrobyHeader(page)
<div id="wyroby">
for _, product:= range products {
@card(product)
}
</div>
</main>
}
}