Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

command: Add themesDir command argument to specify themes directory #2817

Merged
merged 1 commit into from
Dec 22, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions commands/hugo.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ var (
destination string
logFile string
theme string
themesDir string
source string
)

Expand Down Expand Up @@ -219,6 +220,7 @@ func initHugoBuildCommonFlags(cmd *cobra.Command) {
cmd.Flags().BoolP("ignoreCache", "", false, "Ignores the cache directory")
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(&themesDir, "themesDir", "", "", "filesystem path to themes directory")
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().StringVarP(&baseURL, "baseURL", "b", "", "hostname (and path) to the root, e.g. http://spf13.com/")
Expand Down Expand Up @@ -287,6 +289,10 @@ func InitializeConfig(subCmdVs ...*cobra.Command) error {
viper.Set("theme", theme)
}

if themesDir != "" {
viper.Set("themesDir", themesDir)
}

if destination != "" {
viper.Set("publishDir", destination)
}
Expand Down