mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-28 14:40:43 +03:00
Handle disabled RSS even if it's defined in outputs
See https://github.com/gohugoio/hugo/issues/6897#issuecomment-587947078
This commit is contained in:
parent
c7975b48b6
commit
da54787cfa
4 changed files with 31 additions and 8 deletions
|
@ -15,6 +15,7 @@ package hugolib
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/gohugoio/hugo/config"
|
||||
"github.com/gohugoio/hugo/output"
|
||||
|
@ -54,7 +55,7 @@ func createDefaultOutputFormats(allFormats output.Formats, cfg config.Provider)
|
|||
|
||||
}
|
||||
|
||||
func createSiteOutputFormats(allFormats output.Formats, cfg config.Provider) (map[string]output.Formats, error) {
|
||||
func createSiteOutputFormats(allFormats output.Formats, cfg config.Provider, rssDisabled bool) (map[string]output.Formats, error) {
|
||||
defaultOutputFormats := createDefaultOutputFormats(allFormats, cfg)
|
||||
|
||||
if !cfg.IsSet("outputs") {
|
||||
|
@ -82,6 +83,12 @@ func createSiteOutputFormats(allFormats output.Formats, cfg config.Provider) (ma
|
|||
for _, format := range vals {
|
||||
f, found := allFormats.GetByName(format)
|
||||
if !found {
|
||||
if rssDisabled && strings.EqualFold(format, "RSS") {
|
||||
// This is legacy behaviour. We used to have both
|
||||
// a RSS page kind and output format.
|
||||
continue
|
||||
|
||||
}
|
||||
return nil, fmt.Errorf("failed to resolve output format %q from site config", format)
|
||||
}
|
||||
formats = append(formats, f)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue