Fix photos

This commit is contained in:
Jan-Lukas Else 2020-11-10 16:48:59 +01:00
parent 6f79024b31
commit c6d25c0385
2 changed files with 6 additions and 5 deletions

View File

@ -233,9 +233,10 @@ func buildHandler() (http.Handler, error) {
// Photos // Photos
if blogConfig.Photos.Enabled { if blogConfig.Photos.Enabled {
handler := servePhotos(blog) photoPath := blogPath + blogConfig.Photos.Path
r.With(cacheMiddleware, minifier.Middleware).Get(blogPath+blogConfig.Photos.Path, handler) handler := servePhotos(blog, photoPath)
r.With(cacheMiddleware, minifier.Middleware).Get(blogPath+blogConfig.Photos.Path+paginationPath, handler) r.With(cacheMiddleware, minifier.Middleware).Get(photoPath, handler)
r.With(cacheMiddleware, minifier.Middleware).Get(photoPath+paginationPath, handler)
} }
// Blog // Blog

View File

@ -146,10 +146,10 @@ func serveTaxonomyValue(blog string, path string, tax *taxonomy, value string) f
}) })
} }
func servePhotos(blog string) func(w http.ResponseWriter, r *http.Request) { func servePhotos(blog string, path string) func(w http.ResponseWriter, r *http.Request) {
return serveIndex(&indexConfig{ return serveIndex(&indexConfig{
blog: blog, blog: blog,
path: appConfig.Blogs[blog].Photos.Path, path: path,
parameter: appConfig.Blogs[blog].Photos.Parameter, parameter: appConfig.Blogs[blog].Photos.Parameter,
template: templatePhotos, template: templatePhotos,
}) })