fix(gallery): config
This commit is contained in:
@@ -14,7 +14,7 @@ func Default() Cfg {
|
||||
WebsiteID: "54d8a379-77d5-4c20-b46d-5c9a6c9e39bd",
|
||||
},
|
||||
Gallery: &Gallery{
|
||||
Path: "gallery",
|
||||
Path: "photos",
|
||||
},
|
||||
Cache: &Valkey{
|
||||
RefreshTime: time.Minute * 10,
|
||||
|
||||
@@ -3,6 +3,7 @@ package server
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"path"
|
||||
"time"
|
||||
|
||||
"git.schreifuchs.ch/schreifuchs/schreifuchs.ch/internal/components/gallery"
|
||||
@@ -77,7 +78,7 @@ func (s *Server) dynamicRoutes() (h http.Handler, err error) {
|
||||
func() http.Handler {
|
||||
mux := http.NewServeMux()
|
||||
|
||||
mux.Handle("/gallery", restgallery.New(renderer, gallery.New(fs, s.cfg.Gallery, imageSrv, valkeyClient), s.cfg.Gallery))
|
||||
mux.Handle(path.Join("/"+s.cfg.Gallery.Path), restgallery.New(renderer, gallery.New(fs, s.cfg.Gallery, imageSrv, valkeyClient), s.cfg.Gallery))
|
||||
mux.Handle("/", resthome.New(renderer, page.New(fs)))
|
||||
|
||||
return mux
|
||||
|
||||
@@ -11,7 +11,8 @@ templ GallerySet(g gallery.Set) {
|
||||
>
|
||||
for _,img := range g.SM.Images {
|
||||
<img
|
||||
src={ "/images/" + img.UID }
|
||||
src={ "/images/" + img.UID + "?w=600" }
|
||||
loading="lazy"
|
||||
class="w-full"
|
||||
alt="Gallery item"
|
||||
/>
|
||||
@@ -39,7 +40,8 @@ templ Gallery(g gallery.Gallery) {
|
||||
class="overflow-hidden shadow-sm"
|
||||
>
|
||||
<img
|
||||
src={ "/images/" + img.UID }
|
||||
src={ "/images/" + img.UID + "?w=800" }
|
||||
loading="lazy"
|
||||
class="w-full h-full object-cover"
|
||||
alt="Gallery item"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user