From: Anthony Kong Date: Mon, 13 Mar 2017 11:50:57 +0000 (+1100) Subject: commands: Improve jekyll import date format X-Git-Tag: v0.20~143 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=62efcdfe;p=brevno-suite%2Fhugo commands: Improve jekyll import date format Allow both yyyy-mm-dd and yyyy-m-d formats in jekyll markdown file names. --- diff --git a/commands/import_jekyll.go b/commands/import_jekyll.go index c33b68f2..071257d7 100644 --- a/commands/import_jekyll.go +++ b/commands/import_jekyll.go @@ -372,7 +372,7 @@ func parseJekyllFilename(filename string) (time.Time, string, error) { return time.Now(), "", errors.New("filename not match") } - postDate, err := time.Parse("2006-01-02", r[0][1]) + postDate, err := time.Parse("2006-1-2", r[0][1]) if err != nil { return time.Now(), "", err }