mirror of https://github.com/jlelse/GoBlog
Fix photos
This commit is contained in:
parent
6f79024b31
commit
c6d25c0385
7
http.go
7
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
|
||||
|
|
4
posts.go
4
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,
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue