mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-01 18:13:04 -05:00
hugolib: Deprecate rssURI
This commit is contained in:
parent
9a8b65d8d7
commit
9e69a92e85
2 changed files with 10 additions and 7 deletions
|
@ -20,6 +20,7 @@ import (
|
||||||
|
|
||||||
"github.com/spf13/cast"
|
"github.com/spf13/cast"
|
||||||
"github.com/spf13/hugo/config"
|
"github.com/spf13/hugo/config"
|
||||||
|
"github.com/spf13/hugo/helpers"
|
||||||
"github.com/spf13/hugo/output"
|
"github.com/spf13/hugo/output"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -72,15 +73,18 @@ func createDefaultOutputFormats(cfg config.Provider) (map[string]output.Formats,
|
||||||
|
|
||||||
// All but page have RSS
|
// All but page have RSS
|
||||||
if kind != KindPage {
|
if kind != KindPage {
|
||||||
// TODO(bep) output deprecate rssURI
|
rssType := output.RSSFormat
|
||||||
|
|
||||||
rssBase := cfg.GetString("rssURI")
|
rssBase := cfg.GetString("rssURI")
|
||||||
if rssBase == "" {
|
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
|
// RSS has now a well defined media type, so strip any suffix provided
|
||||||
rssBase = strings.TrimSuffix(rssBase, path.Ext(rssBase))
|
rssBase = strings.TrimSuffix(rssBase, path.Ext(rssBase))
|
||||||
rssType := output.RSSFormat
|
}
|
||||||
|
|
||||||
rssType.BaseName = rssBase
|
rssType.BaseName = rssBase
|
||||||
formats = append(formats, rssType)
|
formats = append(formats, rssType)
|
||||||
|
|
||||||
|
|
|
@ -145,7 +145,7 @@ func (s *Site) renderPaginator(p *PageOutput) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(bep) output do better
|
// TODO(bep) do better
|
||||||
link := newOutputFormat(p.Page, p.outputFormat).Permalink()
|
link := newOutputFormat(p.Page, p.outputFormat).Permalink()
|
||||||
if err := s.writeDestAlias(target, link, nil); err != nil {
|
if err := s.writeDestAlias(target, link, nil); err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -222,7 +222,6 @@ func (s *Site) renderRSS(p *PageOutput) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(bep) output deprecate/handle rssURI
|
|
||||||
targetPath, err := p.targetPath()
|
targetPath, err := p.targetPath()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in a new issue