mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-15 20:44:01 +02:00
Updating Convert to handle dates properly for yaml and json
Fix bug with YAML & JSON with handling dates with 'new' and 'convert'
This commit is contained in:
@@ -23,6 +23,7 @@ import (
|
||||
"github.com/spf13/hugo/helpers"
|
||||
"github.com/spf13/hugo/parser"
|
||||
jww "github.com/spf13/jwalterweatherman"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
var siteType string
|
||||
@@ -33,6 +34,7 @@ var contentFrontMatter string
|
||||
|
||||
func init() {
|
||||
newSiteCmd.Flags().StringVarP(&configFormat, "format", "f", "toml", "config & frontmatter format")
|
||||
newCmd.Flags().StringVarP(&configFormat, "format", "f", "toml", "frontmatter format")
|
||||
newCmd.Flags().StringVarP(&contentType, "kind", "k", "", "Content type to create")
|
||||
newCmd.AddCommand(newSiteCmd)
|
||||
newCmd.AddCommand(newThemeCmd)
|
||||
@@ -73,6 +75,10 @@ as you see fit.
|
||||
func NewContent(cmd *cobra.Command, args []string) {
|
||||
InitializeConfig()
|
||||
|
||||
if cmd.Flags().Lookup("format").Changed {
|
||||
viper.Set("MetaDataFormat", configFormat)
|
||||
}
|
||||
|
||||
if len(args) < 1 {
|
||||
cmd.Usage()
|
||||
jww.FATAL.Fatalln("path needs to be provided")
|
||||
|
Reference in New Issue
Block a user