diff --git a/main.go b/main.go index e25e85e..d1ba02d 100644 --- a/main.go +++ b/main.go @@ -447,8 +447,8 @@ func getVars(path string, globals Vars) (Vars, string, error) { // Render expanding zs plugins and variables func render(s string, vars Vars) (string, error) { - openingDelimiter := "{{" - closingDelimiter := "}}" + openingDelimiter := viper.GetString("opening-delim") + closingDelimiter := viper.GetString("closing-delim") out := &bytes.Buffer{} for { @@ -720,7 +720,7 @@ func init() { cobra.OnInitialize(initConfig) RootCmd.PersistentFlags().BoolP("debug", "D", false, "enable debug logging $($ZS_DEBUG)") - RootCmd.PersistentFlags().StringVarP(&configFile, "config", "c", "", "config file (default: .zs/config.yml)") + RootCmd.PersistentFlags().StringVarP(&configFile, "config", "C", "", "config file (default: .zs/config.yml)") RootCmd.PersistentFlags().StringSliceP("extensions", "e", MapKeys(Extensions), "override and enable specific extensions") RootCmd.PersistentFlags().BoolP("production", "p", false, "enable production mode ($ZS_PRODUCTION)") @@ -729,6 +729,9 @@ func init() { RootCmd.PersistentFlags().StringP("keywords", "k", "", "site keywords ($ZS_KEYWORDS)") RootCmd.PersistentFlags().StringSliceP("vars", "v", nil, "additional variables") + RootCmd.PersistentFlags().StringP("opening-delim", "o", "{{", "opening delimiter for plugins") + RootCmd.PersistentFlags().StringP("closing-delim", "c", "{{", "closing delimiter for plugins") + viper.BindPFlag("debug", RootCmd.PersistentFlags().Lookup("debug")) viper.SetDefault("debug", false) @@ -750,6 +753,11 @@ func init() { viper.BindPFlag("vars", RootCmd.PersistentFlags().Lookup("vars")) viper.SetDefault("vars", "") + viper.BindPFlag("opening-delim", RootCmd.PersistentFlags().Lookup("opening-delim")) + viper.SetDefault("opening-delim", "{{") + viper.BindPFlag("closing-delim", RootCmd.PersistentFlags().Lookup("closing-delim")) + viper.SetDefault("closing-delim", "}}") + ServeCmd.Flags().StringP("bind", "b", ":8000", "set the [
]: