diff --git a/.DS_Store b/.DS_Store
index 9f0e34f..fee2f4c 100644
Binary files a/.DS_Store and b/.DS_Store differ
diff --git a/.dockerignore b/.dockerignore
index b28b51f..dfb6eec 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -1,6 +1,4 @@
-resources/inspiration
-resources/src
-resources/scraped
+resources
todo.txt
.gitignore
docker-compose.yml
diff --git a/.idea/.gitignore b/.idea/.gitignore
deleted file mode 100644
index 30cf57e..0000000
--- a/.idea/.gitignore
+++ /dev/null
@@ -1,10 +0,0 @@
-# Default ignored files
-/shelf/
-/workspace.xml
-# Editor-based HTTP Client requests
-/httpRequests/
-# Ignored default folder with query files
-/queries/
-# Datasource local storage ignored files
-/dataSources/
-/dataSources.local.xml
diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml
deleted file mode 100644
index a55e7a1..0000000
--- a/.idea/codeStyles/codeStyleConfig.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
+}
diff --git a/templates/image_templ.go b/html/image_templ.go
similarity index 76%
rename from templates/image_templ.go
rename to html/image_templ.go
index dd68706..9fb2ae8 100644
--- a/templates/image_templ.go
+++ b/html/image_templ.go
@@ -1,7 +1,7 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.3.1020
-package templates
+package html
//lint:file-ignore SA4006 This context is only used if a nested component is present.
@@ -11,47 +11,24 @@ import templruntime "github.com/a-h/templ/runtime"
import (
"crypto/sha256"
"encoding/hex"
- "github.com/h2non/bimg"
"log"
- "os"
+ "piekarnikgosi/utils"
)
func processFilename(input string) (src, dst string) {
- src = "resources/images/" + input
+ src = "img/" + input
hash := sha256.Sum256([]byte(input))
dst = "www/images/" + hex.EncodeToString(hash[:])[:16] + ".avif"
return src, dst
}
-func convertToAvif(fileName string) string {
- src, dst := processFilename(fileName)
-
- _, err := os.Stat(dst)
- if err == nil {
- return dst[4:]
- }
-
- log.Printf("generating image: %s %s", src, dst)
-
- buffer, err := bimg.Read(src)
- if err != nil {
- log.Fatal(err)
- }
-
- options := bimg.Options{
- Type: bimg.AVIF,
- Quality: 85,
- }
- newImage, err := bimg.NewImage(buffer).Process(options)
+func ProcessImage(fileName string) string {
+ dst, err := utils.CopyFile(processFilename(fileName))
if err != nil {
log.Fatal(err)
}
- if err := bimg.Write(dst, newImage); err != nil {
- log.Fatal(err)
- }
-
return dst[4:]
}
@@ -81,9 +58,9 @@ func AvifImage(srcPath, alt string) templ.Component {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var2 string
- templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.ResolveAttributeValue(convertToAvif(srcPath))
+ templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.ResolveAttributeValue(ProcessImage(srcPath))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/image.templ`, Line: 51, Col: 34}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `html/image.templ`, Line: 28, Col: 33}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var2)
if templ_7745c5c3_Err != nil {
@@ -96,7 +73,7 @@ func AvifImage(srcPath, alt string) templ.Component {
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.ResolveAttributeValue(alt)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/image.templ`, Line: 51, Col: 46}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `html/image.templ`, Line: 28, Col: 45}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var3)
if templ_7745c5c3_Err != nil {
diff --git a/templates/index.templ b/html/index.templ
similarity index 99%
rename from templates/index.templ
rename to html/index.templ
index d534966..de45fd4 100644
--- a/templates/index.templ
+++ b/html/index.templ
@@ -1,4 +1,4 @@
-package templates
+package html
templ Index() {
@layout("index") {
diff --git a/templates/index_templ.go b/html/index_templ.go
similarity index 99%
rename from templates/index_templ.go
rename to html/index_templ.go
index 1d8f113..0e89146 100644
--- a/templates/index_templ.go
+++ b/html/index_templ.go
@@ -1,7 +1,7 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.3.1020
-package templates
+package html
//lint:file-ignore SA4006 This context is only used if a nested component is present.
diff --git a/templates/kawiarnia.templ b/html/kawiarnia.templ
similarity index 99%
rename from templates/kawiarnia.templ
rename to html/kawiarnia.templ
index 940527c..d8fde69 100644
--- a/templates/kawiarnia.templ
+++ b/html/kawiarnia.templ
@@ -1,4 +1,4 @@
-package templates
+package html
templ Kawiarnia() {
@layout("kawiarnia") {
diff --git a/templates/kawiarnia_templ.go b/html/kawiarnia_templ.go
similarity index 99%
rename from templates/kawiarnia_templ.go
rename to html/kawiarnia_templ.go
index 484494a..de18a7b 100644
--- a/templates/kawiarnia_templ.go
+++ b/html/kawiarnia_templ.go
@@ -1,7 +1,7 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.3.1020
-package templates
+package html
//lint:file-ignore SA4006 This context is only used if a nested component is present.
diff --git a/templates/layout.templ b/html/layout.templ
similarity index 98%
rename from templates/layout.templ
rename to html/layout.templ
index 2a0bedb..91dbaeb 100644
--- a/templates/layout.templ
+++ b/html/layout.templ
@@ -1,4 +1,4 @@
-package templates
+package html
import "fmt"
@@ -11,13 +11,13 @@ templ layout(activePage string) {
-
+