Skip to content

Commit

Permalink
allow 1-digit hour for pub date format
Browse files Browse the repository at this point in the history
  • Loading branch information
mna committed Aug 6, 2013
1 parent 6acf549 commit 5fdadfc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Lang: en
Etc.
```

The three dashes delimit the front matter. It must be there, beginning and end. Between the dashes, the part before the colon `:` is the key, and after is the value. Simple as that. Title, Description, Author, Date and Lang are recognized. Valid date formats are *2006-01-02*, *2006-01-02 15h*, *2006-01-02 15:04* or the RCF3339 format (*2013-08-06T17:48:01-05:00*).
The three dashes delimit the front matter. It must be there, beginning and end. Between the dashes, the part before the colon `:` is the key, and after is the value. Simple as that. Title, Description, Author, Date and Lang are recognized. Valid date formats are `2006-01-02`, `2006-01-02 15h` (or `2006-01-02 8h`), `2006-01-02 15:04` (or `2006-01-02 8:17`) or the RCF3339 format (`2013-08-06T17:48:01-05:00`).

## License

Expand Down
2 changes: 2 additions & 0 deletions tpldata.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ var (
// Lookup table to find the format based on the length of the date in the front matter
pubDtFmt = map[int]string{
10: "2006-01-02",
13: "2006-01-02 15h",
14: "2006-01-02 15h",
15: "2006-01-02 15:04",
16: "2006-01-02 15:04",
25: time.RFC3339,
}
Expand Down

0 comments on commit 5fdadfc

Please sign in to comment.