Skip to content

Commit

Permalink
hugolib: Remove deprecated rssURI
Browse files Browse the repository at this point in the history
  • Loading branch information
bep committed Sep 21, 2018
1 parent df4cbbd commit f1a00b2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 21 deletions.
4 changes: 2 additions & 2 deletions hugolib/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ func loadDefaultSettingsFor(v *viper.Viper) error {
v.SetDefault("disableFastRender", false)
v.SetDefault("timeout", 10000) // 10 seconds

// Remove in Hugo 0.39
// Remove in Hugo 0.50

if v.GetBool("useModTimeAsFallback") {

Expand All @@ -480,7 +480,7 @@ func loadDefaultSettingsFor(v *viper.Viper) error {
[frontmatter]
date = [ "date",":fileModTime", ":default"]
lastmod = ["lastmod" ,":fileModTime", ":default"]
`, false)
`, true)

}

Expand Down
3 changes: 1 addition & 2 deletions hugolib/rss_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@ func TestRSSOutput(t *testing.T) {

rssLimit := len(weightedSources) - 1

rssURI := "customrss.xml"
rssURI := "index.xml"

cfg.Set("baseURL", "http://auth/bub/")
cfg.Set("rssURI", rssURI)
cfg.Set("title", "RSSTest")
cfg.Set("rssLimit", rssLimit)

Expand Down
17 changes: 0 additions & 17 deletions hugolib/site_output.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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},
Expand Down

0 comments on commit f1a00b2

Please sign in to comment.