hugo

Unnamed repository; edit this file 'description' to name the repository.

git clone git://git.shimmy1996.com/hugo.git
commit d418c2c2eacdc1dc6fffe839e0a90600867878ca
parent b2fcbb1f9774aa1e929b8575c0e1ac366ab2fb73
Author: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Date:   Thu, 25 Jan 2018 09:58:55 +0100

Remove and update deprecation status

Diffstat:
Mcommands/hugo.go | 19-------------------
Mhugolib/config.go | 21---------------------
Mhugolib/hugo_sites.go | 4----
Mhugolib/hugo_sites_build_test.go | 6------
Mhugolib/page.go | 12------------
Mhugolib/page_paths.go | 6------
Mhugolib/page_test.go | 1-
Mhugolib/site.go | 5-----
Mhugolib/site_output.go | 4++--
Mhugolib/site_render.go | 12------------
Mhugolib/site_test.go | 2--
11 files changed, 2 insertions(+), 90 deletions(-)
diff --git a/commands/hugo.go b/commands/hugo.go
@@ -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)
 	}
diff --git a/hugolib/config.go b/hugolib/config.go
@@ -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")
diff --git a/hugolib/hugo_sites.go b/hugolib/hugo_sites.go
@@ -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) {
diff --git a/hugolib/hugo_sites_build_test.go b/hugolib/hugo_sites_build_test.go
@@ -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,
diff --git a/hugolib/page.go b/hugolib/page.go
@@ -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
 }
diff --git a/hugolib/page_paths.go b/hugolib/page_paths.go
@@ -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 ""
-}
diff --git a/hugolib/page_test.go b/hugolib/page_test.go
@@ -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()
diff --git a/hugolib/site.go b/hugolib/site.go
@@ -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)
 }
diff --git a/hugolib/site_output.go b/hugolib/site_output.go
@@ -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))
 			}
diff --git a/hugolib/site_render.go b/hugolib/site_render.go
@@ -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)
diff --git a/hugolib/site_test.go b/hugolib/site_test.go
@@ -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{}{