trivial fixes
This commit is contained in:
parent
8512c9e3d7
commit
dd50d34703
17 changed files with 25 additions and 31 deletions
BIN
.DS_Store
vendored
BIN
.DS_Store
vendored
Binary file not shown.
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -1,2 +1,4 @@
|
||||||
www
|
www
|
||||||
docker-compose.yml
|
docker-compose.yml
|
||||||
|
todo.txt
|
||||||
|
.DS_Store
|
||||||
|
|
|
||||||
|
|
@ -71,11 +71,11 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
top: 0;
|
transform: translateY(0);
|
||||||
transition: top 0.2s;
|
transition: transform 0.2s;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
top: -10px;
|
transform: translateY(-10px);
|
||||||
|
|
||||||
& img {
|
& img {
|
||||||
scale: 1.1;
|
scale: 1.1;
|
||||||
|
|
|
||||||
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"
|
"piekarnikgosi/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func processFilename(input string) (src, dst string) {
|
func imageSrcDst(input string) (src, dst string) {
|
||||||
src = "img/" + input
|
src = "img/" + input
|
||||||
hash := sha256.Sum256([]byte(input))
|
hash := sha256.Sum256([]byte(input))
|
||||||
dst = "www/images/" + hex.EncodeToString(hash[:])[:16] + ".avif"
|
dst = "www/images/" + hex.EncodeToString(hash[:])[:16] + ".avif"
|
||||||
|
|
@ -15,7 +15,7 @@ func processFilename(input string) (src, dst string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func ProcessImage(fileName string) string {
|
func ProcessImage(fileName string) string {
|
||||||
dst, err := utils.CopyFile(processFilename(fileName))
|
dst, err := utils.CopyIfNotExists(imageSrcDst(fileName))
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ import (
|
||||||
"piekarnikgosi/utils"
|
"piekarnikgosi/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func processFilename(input string) (src, dst string) {
|
func imageSrcDst(input string) (src, dst string) {
|
||||||
src = "img/" + input
|
src = "img/" + input
|
||||||
hash := sha256.Sum256([]byte(input))
|
hash := sha256.Sum256([]byte(input))
|
||||||
dst = "www/images/" + hex.EncodeToString(hash[:])[:16] + ".avif"
|
dst = "www/images/" + hex.EncodeToString(hash[:])[:16] + ".avif"
|
||||||
|
|
@ -23,7 +23,7 @@ func processFilename(input string) (src, dst string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func ProcessImage(fileName string) string {
|
func ProcessImage(fileName string) string {
|
||||||
dst, err := utils.CopyFile(processFilename(fileName))
|
dst, err := utils.CopyIfNotExists(imageSrcDst(fileName))
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
|
|
|
||||||
|
|
@ -156,7 +156,7 @@ templ Kawiarnia() {
|
||||||
<h3>Słodkości</h3>
|
<h3>Słodkości</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<p>Codziennie pieczemy coś innego! Zapytaj obsługę o dzisiejsze smaki.</p>
|
<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>Deserki</p><span>5 - 15 PLN</span></li>
|
||||||
<li><p>Mini Pavlova</p><span>12 PLN</span></li>
|
<li><p>Mini Pavlova</p><span>12 PLN</span></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
@ -185,7 +185,6 @@ templ Kawiarnia() {
|
||||||
<li><p>Cytryna</p><span>10 PLN</span></li>
|
<li><p>Cytryna</p><span>10 PLN</span></li>
|
||||||
<li><p>Imbir</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>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>
|
<li><p>Ice Tea</p><span>18 PLN</span></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
BIN
img/.DS_Store
vendored
BIN
img/.DS_Store
vendored
Binary file not shown.
BIN
img/portfolio/.DS_Store
vendored
BIN
img/portfolio/.DS_Store
vendored
Binary file not shown.
BIN
img/wyroby/.DS_Store
vendored
BIN
img/wyroby/.DS_Store
vendored
Binary file not shown.
13
main.go
13
main.go
|
|
@ -99,13 +99,20 @@ func ensureDir() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func mustCopy(src, dst string) {
|
||||||
|
_, err := utils.CopyIfNotExists(src, dst)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("copying %s: %s", src, err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
ensureDir()
|
ensureDir()
|
||||||
generateHTML()
|
generateHTML()
|
||||||
mergeStyles()
|
mergeStyles()
|
||||||
utils.CopyFile("img/favicon.avif", "www/images/favicon.avif")
|
mustCopy("img/favicon.avif", "www/images/favicon.avif")
|
||||||
utils.CopyFile("img/logo.svg", "www/images/logo.svg")
|
mustCopy("img/logo.svg", "www/images/logo.svg")
|
||||||
utils.CopyFile("js/portfolio.js", "www/portfolio.js")
|
mustCopy("js/portfolio.js", "www/portfolio.js")
|
||||||
log.Println("listening on :8000")
|
log.Println("listening on :8000")
|
||||||
log.Fatal(http.ListenAndServe(":8000", http.FileServer(http.Dir("www"))))
|
log.Fatal(http.ListenAndServe(":8000", http.FileServer(http.Dir("www"))))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
BIN
resources/.DS_Store
vendored
BIN
resources/.DS_Store
vendored
Binary file not shown.
BIN
resources/inspiration/.DS_Store
vendored
BIN
resources/inspiration/.DS_Store
vendored
Binary file not shown.
BIN
resources/scraped/.DS_Store
vendored
BIN
resources/scraped/.DS_Store
vendored
Binary file not shown.
17
todo.txt
17
todo.txt
|
|
@ -1,17 +0,0 @@
|
||||||
sernik klasyczny
|
|
||||||
sernik królewski
|
|
||||||
pleśniak
|
|
||||||
leśny mech z musem truskawkowym
|
|
||||||
snickers
|
|
||||||
mleczna kanapka
|
|
||||||
3 bit
|
|
||||||
biszkoptowe z kremem i owocami w galaretce
|
|
||||||
kora orzechowa
|
|
||||||
nutelowiec z wiśniami
|
|
||||||
karpatka
|
|
||||||
|
|
||||||
mobile version
|
|
||||||
fix header alignement in wyroby
|
|
||||||
lody
|
|
||||||
portfolio
|
|
||||||
reszta ciast
|
|
||||||
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
func CopyFile(src, dst string) (string, error) {
|
func CopyIfNotExists(src, dst string) (string, error) {
|
||||||
_, err := os.Stat(dst)
|
_, err := os.Stat(dst)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return dst, nil
|
return dst, nil
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue