hugo

Unnamed repository; edit this file 'description' to name the repository.

git clone git://git.shimmy1996.com/hugo.git
commit 9e69a92e85937c6e59839e58937ed1db1e497557
parent 9a8b65d8d704296be6db3d39a1e3cf6458233995
Author: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Date:   Sat,  8 Apr 2017 10:45:11 +0200

hugolib: Deprecate rssURI

Diffstat:
Mhugolib/site_output.go | 14+++++++++-----
Mhugolib/site_render.go | 3+--
2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/hugolib/site_output.go b/hugolib/site_output.go
@@ -20,6 +20,7 @@ import (
 
 	"github.com/spf13/cast"
 	"github.com/spf13/hugo/config"
+	"github.com/spf13/hugo/helpers"
 	"github.com/spf13/hugo/output"
 )
 
@@ -72,15 +73,18 @@ func createDefaultOutputFormats(cfg config.Provider) (map[string]output.Formats,
 
 		// All but page have RSS
 		if kind != KindPage {
-			// TODO(bep) output deprecate rssURI
+			rssType := output.RSSFormat
+
 			rssBase := cfg.GetString("rssURI")
 			if rssBase == "" {
-				rssBase = "index"
+				rssBase = rssType.BaseName
+			} else {
+				// Remove in Hugo 0.22.
+				helpers.Deprecated("Site config", "rssURI", "Set baseName in outputFormats.RSS", false)
+				// RSS has now a well defined media type, so strip any suffix provided
+				rssBase = strings.TrimSuffix(rssBase, path.Ext(rssBase))
 			}
 
-			// RSS has now a well defined media type, so strip any suffix provided
-			rssBase = strings.TrimSuffix(rssBase, path.Ext(rssBase))
-			rssType := output.RSSFormat
 			rssType.BaseName = rssBase
 			formats = append(formats, rssType)
 
diff --git a/hugolib/site_render.go b/hugolib/site_render.go
@@ -145,7 +145,7 @@ func (s *Site) renderPaginator(p *PageOutput) error {
 			return err
 		}
 
-		// TODO(bep) output do better
+		// TODO(bep) do better
 		link := newOutputFormat(p.Page, p.outputFormat).Permalink()
 		if err := s.writeDestAlias(target, link, nil); err != nil {
 			return err
@@ -222,7 +222,6 @@ func (s *Site) renderRSS(p *PageOutput) error {
 		return err
 	}
 
-	// TODO(bep) output deprecate/handle rssURI
 	targetPath, err := p.targetPath()
 	if err != nil {
 		return err