trivial fixes
This commit is contained in:
parent
8512c9e3d7
commit
dd50d34703
17 changed files with 25 additions and 31 deletions
3
html/doc.go
Normal file
3
html/doc.go
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
//go:generate templ generate
|
||||
|
||||
package html
|
||||
|
|
@ -7,7 +7,7 @@ import (
|
|||
"piekarnikgosi/utils"
|
||||
)
|
||||
|
||||
func processFilename(input string) (src, dst string) {
|
||||
func imageSrcDst(input string) (src, dst string) {
|
||||
src = "img/" + input
|
||||
hash := sha256.Sum256([]byte(input))
|
||||
dst = "www/images/" + hex.EncodeToString(hash[:])[:16] + ".avif"
|
||||
|
|
@ -15,7 +15,7 @@ func processFilename(input string) (src, dst string) {
|
|||
}
|
||||
|
||||
func ProcessImage(fileName string) string {
|
||||
dst, err := utils.CopyFile(processFilename(fileName))
|
||||
dst, err := utils.CopyIfNotExists(imageSrcDst(fileName))
|
||||
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import (
|
|||
"piekarnikgosi/utils"
|
||||
)
|
||||
|
||||
func processFilename(input string) (src, dst string) {
|
||||
func imageSrcDst(input string) (src, dst string) {
|
||||
src = "img/" + input
|
||||
hash := sha256.Sum256([]byte(input))
|
||||
dst = "www/images/" + hex.EncodeToString(hash[:])[:16] + ".avif"
|
||||
|
|
@ -23,7 +23,7 @@ func processFilename(input string) (src, dst string) {
|
|||
}
|
||||
|
||||
func ProcessImage(fileName string) string {
|
||||
dst, err := utils.CopyFile(processFilename(fileName))
|
||||
dst, err := utils.CopyIfNotExists(imageSrcDst(fileName))
|
||||
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ templ Kawiarnia() {
|
|||
<h3>Słodkości</h3>
|
||||
<ul>
|
||||
<p>Codziennie pieczemy coś innego! Zapytaj obsługę o dzisiejsze smaki.</p>
|
||||
<li><p>Domowe ciasta</p><span>10 - 20 LN</span></li>
|
||||
<li><p>Domowe ciasta</p><span>10 - 20 PLN</span></li>
|
||||
<li><p>Deserki</p><span>5 - 15 PLN</span></li>
|
||||
<li><p>Mini Pavlova</p><span>12 PLN</span></li>
|
||||
</ul>
|
||||
|
|
@ -185,7 +185,6 @@ templ Kawiarnia() {
|
|||
<li><p>Cytryna</p><span>10 PLN</span></li>
|
||||
<li><p>Imbir</p><span>10 PLN</span></li>
|
||||
<li><p>Owocowa</p><span>10 PLN</span></li>
|
||||
<li><p>Cappucino</p><span>10 PLN</span></li>
|
||||
<li><p>Ice Tea</p><span>18 PLN</span></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue