mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
Added internal rss.xml template and config option to turn off rss creation
This commit is contained in:
@@ -48,7 +48,7 @@ Complete documentation is available at http://hugo.spf13.com`,
|
||||
}
|
||||
var hugoCmdV *cobra.Command
|
||||
|
||||
var BuildWatch, Draft, UglyUrls, Verbose, Logging, VerboseLog bool
|
||||
var BuildWatch, Draft, UglyUrls, Verbose, Logging, VerboseLog, DisableRSS bool
|
||||
var Source, Destination, BaseUrl, CfgFile, LogFile string
|
||||
|
||||
func Execute() {
|
||||
@@ -65,6 +65,7 @@ func AddCommands() {
|
||||
|
||||
func init() {
|
||||
HugoCmd.PersistentFlags().BoolVarP(&Draft, "build-drafts", "D", false, "include content marked as draft")
|
||||
HugoCmd.PersistentFlags().BoolVar(&DisableRSS, "disableRSS", false, "Do not build RSS files")
|
||||
HugoCmd.PersistentFlags().StringVarP(&Source, "source", "s", "", "filesystem path to read files relative from")
|
||||
HugoCmd.PersistentFlags().StringVarP(&Destination, "destination", "d", "", "filesystem path to write files to")
|
||||
HugoCmd.PersistentFlags().BoolVarP(&Verbose, "verbose", "v", false, "verbose output")
|
||||
@@ -86,6 +87,7 @@ func InitializeConfig() {
|
||||
|
||||
viper.RegisterAlias("taxonomies", "indexes")
|
||||
|
||||
viper.SetDefault("DisableRSS", false)
|
||||
viper.SetDefault("ContentDir", "content")
|
||||
viper.SetDefault("LayoutDir", "layouts")
|
||||
viper.SetDefault("StaticDir", "static")
|
||||
@@ -106,6 +108,10 @@ func InitializeConfig() {
|
||||
viper.Set("UglyUrls", UglyUrls)
|
||||
}
|
||||
|
||||
if hugoCmdV.PersistentFlags().Lookup("disableRSS").Changed {
|
||||
viper.Set("DisableRSS", DisableRSS)
|
||||
}
|
||||
|
||||
if hugoCmdV.PersistentFlags().Lookup("verbose").Changed {
|
||||
viper.Set("Verbose", Verbose)
|
||||
}
|
||||
|
Reference in New Issue
Block a user