diff --git a/images.go b/images.go index fe8a4e9..aa4b471 100644 --- a/images.go +++ b/images.go @@ -66,6 +66,8 @@ func fetchImageResults(query string, safe, lang string, page int) ([]ImageSearch lang = "en_CA" } + // Format &lang=lang_de is incorret, implement fix ! + apiURL := fmt.Sprintf("https://api.qwant.com/v3/search/images?t=images&q=%s&count=%d&locale=%s&offset=%d&device=desktop&tgp=2&safesearch=%s", url.QueryEscape(query), resultsPerPage, @@ -100,11 +102,11 @@ func fetchImageResults(query string, safe, lang string, page int) ([]ImageSearch var results []ImageSearchResult for _, item := range apiResp.Data.Result.Items { results = append(results, ImageSearchResult{ - Thumbnail: item.Thumbnail, // Thumbnail URL - Title: item.Title, // Image title - Media: item.Media, // Direct link to the image - Ensure this field is used appropriately in your template - Source: item.Media, // Using item.Media here ensures the direct image link is used - ThumbProxy: "/img_proxy?url=" + url.QueryEscape(item.Media), // Proxy URL for the thumbnail, if needed + Thumbnail: item.Thumbnail, // Thumbnail URL + Title: item.Title, // Image title + Media: item.Media, // Direct link to the image + Source: item.Url, + ThumbProxy: "/img_proxy?url=" + url.QueryEscape(item.Media), Width: item.Width, Height: item.Height, }) diff --git a/main.go b/main.go index ab059fb..4e866af 100644 --- a/main.go +++ b/main.go @@ -110,7 +110,7 @@ func handleSearch(w http.ResponseWriter, r *http.Request) { case "video": videoSearchEndpointHandler(w, r) case "map": - handleMapSearch(w, query, safe) // implement map results + handleMapSearch(w, query, safe) default: http.ServeFile(w, r, "templates/search.html") } diff --git a/static/css/style.css b/static/css/style.css index b8171d2..f91dc58 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -1138,6 +1138,10 @@ p { text-decoration: none; } +.js-enabled { + display: none; +} + .logomobile { position: absolute; margin-top: 0px; diff --git a/templates/images.html b/templates/images.html index 189cbff..a26b81d 100644 --- a/templates/images.html +++ b/templates/images.html @@ -5,9 +5,6 @@ {{.Query}} - Ocásek -
@@ -58,8 +55,8 @@ {{end}} - -
+ +
{{ if .Results }}