diff --git a/http.go b/http.go index 2d77d2c..57f3ea6 100644 --- a/http.go +++ b/http.go @@ -233,9 +233,10 @@ func buildHandler() (http.Handler, error) { // Photos if blogConfig.Photos.Enabled { - handler := servePhotos(blog) - r.With(cacheMiddleware, minifier.Middleware).Get(blogPath+blogConfig.Photos.Path, handler) - r.With(cacheMiddleware, minifier.Middleware).Get(blogPath+blogConfig.Photos.Path+paginationPath, handler) + photoPath := blogPath + blogConfig.Photos.Path + handler := servePhotos(blog, photoPath) + r.With(cacheMiddleware, minifier.Middleware).Get(photoPath, handler) + r.With(cacheMiddleware, minifier.Middleware).Get(photoPath+paginationPath, handler) } // Blog diff --git a/posts.go b/posts.go index 6c0bca0..5860fb9 100644 --- a/posts.go +++ b/posts.go @@ -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{ blog: blog, - path: appConfig.Blogs[blog].Photos.Path, + path: path, parameter: appConfig.Blogs[blog].Photos.Parameter, template: templatePhotos, })