mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
Do not create robots.txt by default
Meny people, including me, have a custom robots.txt in static. Also remove that option from the command line; it doesn't feel important enough. Fixes ##2049
This commit is contained in:
@@ -126,7 +126,7 @@ var (
|
||||
buildWatch bool
|
||||
canonifyURLs bool
|
||||
cleanDestination bool
|
||||
disableRobotsTXT bool
|
||||
enableRobotsTXT bool
|
||||
disableRSS bool
|
||||
disableSitemap bool
|
||||
draft bool
|
||||
@@ -216,7 +216,6 @@ func initHugoBuildCommonFlags(cmd *cobra.Command) {
|
||||
cmd.Flags().BoolVarP(&future, "buildFuture", "F", false, "include content with publishdate in the future")
|
||||
cmd.Flags().BoolVar(&disableRSS, "disableRSS", false, "Do not build RSS files")
|
||||
cmd.Flags().BoolVar(&disableSitemap, "disableSitemap", false, "Do not build Sitemap file")
|
||||
cmd.Flags().BoolVar(&disableRobotsTXT, "disableRobotsTXT", false, "Do not build Robots TXT 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")
|
||||
@@ -364,8 +363,8 @@ func InitializeConfig(subCmdVs ...*cobra.Command) error {
|
||||
if flagChanged(cmdV.Flags(), "disableSitemap") {
|
||||
viper.Set("DisableSitemap", disableSitemap)
|
||||
}
|
||||
if flagChanged(cmdV.Flags(), "disableRobotsTXT") {
|
||||
viper.Set("DisableRobotsTXT", disableRobotsTXT)
|
||||
if flagChanged(cmdV.Flags(), "enableRobotsTXT") {
|
||||
viper.Set("EnableRobotsTXT", enableRobotsTXT)
|
||||
}
|
||||
if flagChanged(cmdV.Flags(), "pluralizeListTitles") {
|
||||
viper.Set("PluralizeListTitles", pluralizeListTitles)
|
||||
|
Reference in New Issue
Block a user