hugolib: Remove deprecated rssURI

This commit is contained in:
Bjørn Erik Pedersen 2018-09-21 14:30:57 +02:00
parent df4cbbd3bd
commit f1a00b2069
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F
3 changed files with 3 additions and 21 deletions

View file

@ -15,11 +15,8 @@ package hugolib
import (
"fmt"
"path"
"strings"
"github.com/gohugoio/hugo/config"
"github.com/gohugoio/hugo/helpers"
"github.com/gohugoio/hugo/output"
"github.com/spf13/cast"
)
@ -30,20 +27,6 @@ func createDefaultOutputFormats(allFormats output.Formats, cfg config.Provider)
robotsOut, _ := allFormats.GetByName(output.RobotsTxtFormat.Name)
sitemapOut, _ := allFormats.GetByName(output.SitemapFormat.Name)
// TODO(bep) this mumbo jumbo is deprecated and should be removed, but there are tests that
// depends on this, so that will have to wait.
rssBase := cfg.GetString("rssURI")
if rssBase == "" || rssBase == "index.xml" {
rssBase = rssOut.BaseName
} else {
// Remove in Hugo 0.36.
helpers.Deprecated("Site config", "rssURI", "Set baseName in outputFormats.RSS", true)
// RSS has now a well defined media type, so strip any suffix provided
rssBase = strings.TrimSuffix(rssBase, path.Ext(rssBase))
}
rssOut.BaseName = rssBase
return map[string]output.Formats{
KindPage: output.Formats{htmlOut},
KindHome: output.Formats{htmlOut, rssOut},