summaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorIvan Fraixedes <ivan@fraixed.es>2015-12-08 21:13:09 +0000
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2016-01-05 23:36:16 +0100
commit9a6dc6c791f47e1d410956cb16cc42a0117f7246 (patch)
tree83262271b13d4d0af9b117ac017b99168b6c9709 /commands
parent7c5a1fd16bc76f010d2321371e3c2ef95b53556d (diff)
Add embeded template for robots.txt
Diffstat (limited to 'commands')
-rw-r--r--commands/hugo.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/commands/hugo.go b/commands/hugo.go
index 4d3f9bab6..3b2e172c6 100644
--- a/commands/hugo.go
+++ b/commands/hugo.go
@@ -112,7 +112,7 @@ Complete documentation is available at http://gohugo.io/.`,
var hugoCmdV *cobra.Command
// Flags that are to be added to commands.
-var BuildWatch, IgnoreCache, Draft, Future, UglyURLs, CanonifyURLs, Verbose, Logging, VerboseLog, DisableRSS, DisableSitemap, PluralizeListTitles, PreserveTaxonomyNames, NoTimes, ForceSync bool
+var BuildWatch, IgnoreCache, Draft, Future, UglyURLs, CanonifyURLs, Verbose, Logging, VerboseLog, DisableRSS, DisableSitemap, DisableRobotsTXT, PluralizeListTitles, PreserveTaxonomyNames, NoTimes, ForceSync bool
var Source, CacheDir, Destination, Theme, BaseURL, CfgFile, LogFile, Editor string
// Execute adds all child commands to the root command HugoCmd and sets flags appropriately.
@@ -159,6 +159,7 @@ func initCoreCommonFlags(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(&CacheDir, "cacheDir", "", "", "filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/")
cmd.Flags().BoolVarP(&IgnoreCache, "ignoreCache", "", false, "Ignores the cache directory for reading but still writes to it")
@@ -204,6 +205,7 @@ func LoadDefaultSettings() {
viper.SetDefault("MetaDataFormat", "toml")
viper.SetDefault("DisableRSS", false)
viper.SetDefault("DisableSitemap", false)
+ viper.SetDefault("DisableRobotsTXT", false)
viper.SetDefault("ContentDir", "content")
viper.SetDefault("LayoutDir", "layouts")
viper.SetDefault("StaticDir", "static")
@@ -294,6 +296,9 @@ func InitializeConfig(subCmdVs ...*cobra.Command) error {
if cmdV.Flags().Lookup("disableSitemap").Changed {
viper.Set("DisableSitemap", DisableSitemap)
}
+ if cmdV.Flags().Lookup("disableRobotsTXT").Changed {
+ viper.Set("DisableRobotsTXT", DisableRobotsTXT)
+ }
if cmdV.Flags().Lookup("pluralizeListTitles").Changed {
viper.Set("PluralizeListTitles", PluralizeListTitles)
}