Remove and update deprecation status

This commit is contained in:
Bjørn Erik Pedersen 2018-01-25 09:58:55 +01:00
parent b2fcbb1f97
commit d418c2c2ea
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F
11 changed files with 2 additions and 90 deletions

View file

@ -242,9 +242,6 @@ func initHugoBuildCommonFlags(cmd *cobra.Command) {
cmd.Flags().BoolP("buildDrafts", "D", false, "include content marked as draft")
cmd.Flags().BoolP("buildFuture", "F", false, "include content with publishdate in the future")
cmd.Flags().BoolP("buildExpired", "E", false, "include expired content")
cmd.Flags().Bool("disable404", false, "do not render 404 page")
cmd.Flags().Bool("disableRSS", false, "do not build RSS files")
cmd.Flags().Bool("disableSitemap", false, "do not build Sitemap file")
cmd.Flags().StringVarP(&source, "source", "s", "", "filesystem path to read files relative from")
cmd.Flags().StringVarP(&contentDir, "contentDir", "c", "", "filesystem path to content directory")
cmd.Flags().StringVarP(&layoutDir, "layoutDir", "l", "", "filesystem path to layout directory")
@ -491,9 +488,6 @@ func (c *commandeer) initializeFlags(cmd *cobra.Command) {
"buildExpired",
"uglyURLs",
"canonifyURLs",
"disable404",
"disableRSS",
"disableSitemap",
"enableRobotsTXT",
"enableGitInfo",
"pluralizeListTitles",
@ -506,19 +500,6 @@ func (c *commandeer) initializeFlags(cmd *cobra.Command) {
"templateMetricsHints",
}
// Remove these in Hugo 0.33.
if cmd.Flags().Changed("disable404") {
helpers.Deprecated("command line", "--disable404", "Use --disableKinds=404", true)
}
if cmd.Flags().Changed("disableRSS") {
helpers.Deprecated("command line", "--disableRSS", "Use --disableKinds=RSS", true)
}
if cmd.Flags().Changed("disableSitemap") {
helpers.Deprecated("command line", "--disableSitemap", "Use --disableKinds=sitemap", true)
}
for _, key := range persFlagKeys {
c.setValueFromFlag(cmd.PersistentFlags(), key)
}

View file

@ -64,23 +64,6 @@ func LoadConfig(fs afero.Fs, relativeSourcePath, configFilename string) (*viper.
v.RegisterAlias("indexes", "taxonomies")
// Remove these in Hugo 0.33.
if v.IsSet("disable404") {
helpers.Deprecated("site config", "disable404", "Use disableKinds=[\"404\"]", true)
}
if v.IsSet("disableRSS") {
helpers.Deprecated("site config", "disableRSS", "Use disableKinds=[\"RSS\"]", true)
}
if v.IsSet("disableSitemap") {
helpers.Deprecated("site config", "disableSitemap", "Use disableKinds= [\"sitemap\"]", true)
}
if v.IsSet("disableRobotsTXT") {
helpers.Deprecated("site config", "disableRobotsTXT", "Use disableKinds= [\"robotsTXT\"]", true)
}
if err := loadDefaultSettingsFor(v); err != nil {
return v, err
}
@ -183,10 +166,6 @@ func loadDefaultSettingsFor(v *viper.Viper) error {
v.SetDefault("cleanDestinationDir", false)
v.SetDefault("watch", false)
v.SetDefault("metaDataFormat", "toml")
v.SetDefault("disable404", false)
v.SetDefault("disableRSS", false)
v.SetDefault("disableSitemap", false)
v.SetDefault("disableRobotsTXT", false)
v.SetDefault("contentDir", "content")
v.SetDefault("layoutDir", "layouts")
v.SetDefault("staticDir", "static")

View file

@ -331,10 +331,6 @@ func (h *HugoSites) renderCrossSitesArtifacts() error {
return nil
}
if h.Cfg.GetBool("disableSitemap") {
return nil
}
sitemapEnabled := false
for _, s := range h.Sites {
if s.isEnabled(kindSitemap) {

View file

@ -855,8 +855,6 @@ var tocPageWithShortcodesInHeadingsExpected = `<nav id="TableOfContents">
var multiSiteTOMLConfigTemplate = `
baseURL = "http://example.com/blog"
disableSitemap = false
disableRSS = false
rssURI = "index.xml"
paginate = 1
@ -915,8 +913,6 @@ lag = "lag"
var multiSiteYAMLConfigTemplate = `
baseURL: "http://example.com/blog"
disableSitemap: false
disableRSS: false
rssURI: "index.xml"
disablePathToLower: true
@ -976,8 +972,6 @@ Languages:
var multiSiteJSONConfigTemplate = `
{
"baseURL": "http://example.com/blog",
"disableSitemap": false,
"disableRSS": false,
"rssURI": "index.xml",
"paginate": 1,
"disablePathToLower": true,

View file

@ -881,12 +881,6 @@ func (p *Page) analyzePage() {
})
}
func (p *Page) Extension() string {
// Remove in Hugo 0.22.
helpers.Deprecated("Page", "Extension", "See OutputFormats with its MediaType", true)
return p.extension
}
// HasShortcode return whether the page has a shortcode with the given name.
// This method is mainly motivated with the Hugo Docs site's need for a list
// of pages with the `todo` shortcode in it.
@ -1849,12 +1843,6 @@ func (p *Page) copy() *Page {
return &c
}
func (p *Page) Now() time.Time {
// Delete in Hugo 0.22
helpers.Deprecated("Page", "Now", "Use now (the template func)", true)
return time.Now()
}
func (p *Page) Hugo() *HugoInfo {
return hugoInfo
}

View file

@ -302,9 +302,3 @@ func (p *Page) createRelativeTargetPathForOutputFormat(f output.Format) string {
return tp
}
func (p *Page) TargetPath() (outfile string) {
// Delete in Hugo 0.22
helpers.Deprecated("Page", "TargetPath", "This method does not make sanse any more.", true)
return ""
}

View file

@ -1483,7 +1483,6 @@ func TestIndexPageSimpleMethods(t *testing.T) {
{func(n *Page) bool { return !n.IsPage() }},
{func(n *Page) bool { return n.Scratch() != nil }},
{func(n *Page) bool { return n.Hugo() != nil }},
{func(n *Page) bool { return n.Now().Unix() == time.Now().Unix() }},
} {
n := s.newHomePage()

View file

@ -371,11 +371,6 @@ type SiteInfo struct {
sectionPagesMenu string
}
func (s *SiteInfo) Files() []source.File {
helpers.Deprecated(".Site", "Files", "", true)
return nil
}
func (s *SiteInfo) String() string {
return fmt.Sprintf("Site(%q)", s.Title)
}

View file

@ -81,8 +81,8 @@ func createDefaultOutputFormats(allFormats output.Formats, cfg config.Provider)
if rssBase == "" || rssBase == "index.xml" {
rssBase = rssOut.BaseName
} else {
// Remove in Hugo 0.22.
helpers.Deprecated("Site config", "rssURI", "Set baseName in outputFormats.RSS", false)
// 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))
}

View file

@ -250,10 +250,6 @@ func (s *Site) renderRSS(p *PageOutput) error {
return nil
}
if s.Cfg.GetBool("disableRSS") {
return nil
}
p.Kind = kindRSS
limit := s.Cfg.GetInt("rssLimit")
@ -283,10 +279,6 @@ func (s *Site) render404() error {
return nil
}
if s.Cfg.GetBool("disable404") {
return nil
}
p := s.newNodePage(kind404)
p.title = "404 Page not found"
@ -321,10 +313,6 @@ func (s *Site) renderSitemap() error {
return nil
}
if s.Cfg.GetBool("disableSitemap") {
return nil
}
sitemapDefault := parseSitemap(s.Cfg.GetStringMap("sitemap"))
n := s.newNodePage(kindSitemap)

View file

@ -313,8 +313,6 @@ func doTestShouldAlwaysHaveUglyURLs(t *testing.T, uglyURLs bool) {
cfg.Set("verbose", true)
cfg.Set("baseURL", "http://auth/bub")
cfg.Set("disableSitemap", false)
cfg.Set("disableRSS", false)
cfg.Set("rssURI", "index.xml")
cfg.Set("blackfriday",
map[string]interface{}{