diff --git a/feeds.go b/feeds.go index 961cb8b..62dd878 100644 --- a/feeds.go +++ b/feeds.go @@ -18,6 +18,12 @@ const ( func generateFeed(f feedType, w http.ResponseWriter, r *http.Request, posts []*Post, title string, description string) { now := time.Now() + if title == "" { + title = appConfig.Blog.Title + } + if description == "" { + description = appConfig.Blog.Description + } feed := &feeds.Feed{ Title: title, Description: description, diff --git a/http.go b/http.go index 09b0342..5310151 100644 --- a/http.go +++ b/http.go @@ -137,11 +137,11 @@ func buildHandler() (http.Handler, error) { rootPath := "/" blogPath := "/blog" if routePatterns := routesToStringSlice(r.Routes()); !routePatterns.has(rootPath) { - r.With(cacheMiddleware, minifier.Middleware).Get(rootPath, serveHome(rootPath, NONE)) - r.With(cacheMiddleware, minifier.Middleware).Get(rootPath+rssPath, serveHome(rootPath, RSS)) - r.With(cacheMiddleware, minifier.Middleware).Get(rootPath+jsonPath, serveHome(rootPath, JSON)) - r.With(cacheMiddleware, minifier.Middleware).Get(rootPath+atomPath, serveHome(rootPath, ATOM)) - r.With(cacheMiddleware, minifier.Middleware).Get(paginationPath, serveHome(rootPath, NONE)) + r.With(cacheMiddleware, minifier.Middleware).Get(rootPath, serveHome("", NONE)) + r.With(cacheMiddleware, minifier.Middleware).Get(rootPath+rssPath, serveHome("", RSS)) + r.With(cacheMiddleware, minifier.Middleware).Get(rootPath+jsonPath, serveHome("", JSON)) + r.With(cacheMiddleware, minifier.Middleware).Get(rootPath+atomPath, serveHome("", ATOM)) + r.With(cacheMiddleware, minifier.Middleware).Get(paginationPath, serveHome("", NONE)) } else if !routePatterns.has(blogPath) { r.With(cacheMiddleware, minifier.Middleware).Get(blogPath, serveHome(blogPath, NONE)) r.With(cacheMiddleware, minifier.Middleware).Get(blogPath+rssPath, serveHome(blogPath, RSS)) diff --git a/posts.go b/posts.go index 06a387c..a5d7a09 100644 --- a/posts.go +++ b/posts.go @@ -129,10 +129,6 @@ func serveIndex(path string, sec *section, tax *taxonomy, taxonomyValue string, } else if sec != nil { title = sec.Title description = sec.Description - } else if tax == nil && sec == nil { - // Show no title or description on home - // title = appConfig.Blog.Title - // description = appConfig.Blog.Description } // Check if feed if ft != NONE {