moved to templ

This commit is contained in:
bronkuu 2026-05-27 14:51:26 +02:00
parent 24722ee61c
commit 303d9703f1
28 changed files with 1522 additions and 853 deletions

View file

@ -0,0 +1,32 @@
package templates
import (
"fmt"
"piekarnikgosi/types"
)
templ card(product types.Product) {
<div class="card">
<div>
<img alt={ product.Name } src={ fmt.Sprint("images/wyroby/", product.Image, ".avif") }/>
</div>
<div>
<h3>{ product.Name }</h3>
<span>{ product.Price }zł</span>
<p>{ product.Description }</p>
</div>
</div>
}
templ WyrobyCiasta(products []types.Product) {
@layout("wyroby") {
<main>
@wyrobyHeader("wyroby")
<div id="wyroby">
for _, product:= range products {
@card(product)
}
</div>
</main>
}
}