mirror of https://github.com/jlelse/GoBlog
Small fix
This commit is contained in:
parent
bf9d637468
commit
61cc369518
|
@ -11,6 +11,9 @@ func (a *goBlog) serveGeoMap(w http.ResponseWriter, r *http.Request) {
|
||||||
blog := r.Context().Value(blogKey).(string)
|
blog := r.Context().Value(blogKey).(string)
|
||||||
bc := a.cfg.Blogs[blog]
|
bc := a.cfg.Blogs[blog]
|
||||||
|
|
||||||
|
mapPath := bc.getRelativePath(defaultIfEmpty(bc.Map.Path, defaultGeoMapPath))
|
||||||
|
canonical := a.getFullAddress(mapPath)
|
||||||
|
|
||||||
allPostsWithLocation, err := a.getPosts(&postsRequestConfig{
|
allPostsWithLocation, err := a.getPosts(&postsRequestConfig{
|
||||||
blog: blog,
|
blog: blog,
|
||||||
status: statusPublished,
|
status: statusPublished,
|
||||||
|
@ -25,6 +28,7 @@ func (a *goBlog) serveGeoMap(w http.ResponseWriter, r *http.Request) {
|
||||||
if len(allPostsWithLocation) == 0 {
|
if len(allPostsWithLocation) == 0 {
|
||||||
a.render(w, r, templateGeoMap, &renderData{
|
a.render(w, r, templateGeoMap, &renderData{
|
||||||
BlogString: blog,
|
BlogString: blog,
|
||||||
|
Canonical: canonical,
|
||||||
Data: map[string]interface{}{
|
Data: map[string]interface{}{
|
||||||
"nolocations": true,
|
"nolocations": true,
|
||||||
},
|
},
|
||||||
|
@ -83,10 +87,9 @@ func (a *goBlog) serveGeoMap(w http.ResponseWriter, r *http.Request) {
|
||||||
tracksJson = string(tracksJsonBytes)
|
tracksJson = string(tracksJsonBytes)
|
||||||
}
|
}
|
||||||
|
|
||||||
mapPath := bc.getRelativePath(defaultIfEmpty(bc.Map.Path, defaultGeoMapPath))
|
|
||||||
a.render(w, r, templateGeoMap, &renderData{
|
a.render(w, r, templateGeoMap, &renderData{
|
||||||
BlogString: blog,
|
BlogString: blog,
|
||||||
Canonical: a.getFullAddress(mapPath),
|
Canonical: canonical,
|
||||||
Data: map[string]interface{}{
|
Data: map[string]interface{}{
|
||||||
"locations": locationsJson,
|
"locations": locationsJson,
|
||||||
"tracks": tracksJson,
|
"tracks": tracksJson,
|
||||||
|
|
Loading…
Reference in New Issue