mirror of
https://github.com/gohugoio/hugo.git
synced 2025-03-10 13:22:44 +00:00
command: Add themesDir
command argument to specify themes directory
This commit is contained in:
parent
4845a13c9e
commit
b2687ab1f7
1 changed files with 6 additions and 0 deletions
|
@ -146,6 +146,7 @@ var (
|
||||||
destination string
|
destination string
|
||||||
logFile string
|
logFile string
|
||||||
theme string
|
theme string
|
||||||
|
themesDir string
|
||||||
source string
|
source string
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -219,6 +220,7 @@ func initHugoBuildCommonFlags(cmd *cobra.Command) {
|
||||||
cmd.Flags().BoolP("ignoreCache", "", false, "Ignores the cache directory")
|
cmd.Flags().BoolP("ignoreCache", "", false, "Ignores the cache directory")
|
||||||
cmd.Flags().StringVarP(&destination, "destination", "d", "", "filesystem path to write files to")
|
cmd.Flags().StringVarP(&destination, "destination", "d", "", "filesystem path to write files to")
|
||||||
cmd.Flags().StringVarP(&theme, "theme", "t", "", "theme to use (located in /themes/THEMENAME/)")
|
cmd.Flags().StringVarP(&theme, "theme", "t", "", "theme to use (located in /themes/THEMENAME/)")
|
||||||
|
cmd.Flags().StringVarP(&themesDir, "themesDir", "", "", "filesystem path to themes directory")
|
||||||
cmd.Flags().Bool("uglyURLs", false, "if true, use /filename.html instead of /filename/")
|
cmd.Flags().Bool("uglyURLs", false, "if true, use /filename.html instead of /filename/")
|
||||||
cmd.Flags().Bool("canonifyURLs", false, "if true, all relative URLs will be canonicalized using baseURL")
|
cmd.Flags().Bool("canonifyURLs", false, "if true, all relative URLs will be canonicalized using baseURL")
|
||||||
cmd.Flags().StringVarP(&baseURL, "baseURL", "b", "", "hostname (and path) to the root, e.g. http://spf13.com/")
|
cmd.Flags().StringVarP(&baseURL, "baseURL", "b", "", "hostname (and path) to the root, e.g. http://spf13.com/")
|
||||||
|
@ -287,6 +289,10 @@ func InitializeConfig(subCmdVs ...*cobra.Command) error {
|
||||||
viper.Set("theme", theme)
|
viper.Set("theme", theme)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if themesDir != "" {
|
||||||
|
viper.Set("themesDir", themesDir)
|
||||||
|
}
|
||||||
|
|
||||||
if destination != "" {
|
if destination != "" {
|
||||||
viper.Set("publishDir", destination)
|
viper.Set("publishDir", destination)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue