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")
"buildExpired",
"uglyURLs",
"canonifyURLs",
- "disable404",
- "disableRSS",
- "disableSitemap",
"enableRobotsTXT",
"enableGitInfo",
"pluralizeListTitles",
"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)
}
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
}
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")
return nil
}
- if h.Cfg.GetBool("disableSitemap") {
- return nil
- }
-
sitemapEnabled := false
for _, s := range h.Sites {
if s.isEnabled(kindSitemap) {
var multiSiteTOMLConfigTemplate = `
baseURL = "http://example.com/blog"
-disableSitemap = false
-disableRSS = false
rssURI = "index.xml"
paginate = 1
var multiSiteYAMLConfigTemplate = `
baseURL: "http://example.com/blog"
-disableSitemap: false
-disableRSS: false
rssURI: "index.xml"
disablePathToLower: true
var multiSiteJSONConfigTemplate = `
{
"baseURL": "http://example.com/blog",
- "disableSitemap": false,
- "disableRSS": false,
"rssURI": "index.xml",
"paginate": 1,
"disablePathToLower": true,
})
}
-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.
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
}
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 ""
-}
{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()
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)
}
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))
}
return nil
}
- if s.Cfg.GetBool("disableRSS") {
- return nil
- }
-
p.Kind = kindRSS
limit := s.Cfg.GetInt("rssLimit")
return nil
}
- if s.Cfg.GetBool("disable404") {
- return nil
- }
-
p := s.newNodePage(kind404)
p.title = "404 Page not found"
return nil
}
- if s.Cfg.GetBool("disableSitemap") {
- return nil
- }
-
sitemapDefault := parseSitemap(s.Cfg.GetStringMap("sitemap"))
n := s.newNodePage(kindSitemap)
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{}{