formatted date
This commit is contained in:
parent
9ca50eafff
commit
968fb30f53
|
@ -4,7 +4,7 @@
|
|||
<small>
|
||||
Published:
|
||||
<time class="dt-published" datetime="{{.Post.Meta.Date}}">
|
||||
{{.Post.Meta.Date}}
|
||||
{{.Post.Meta.FormattedDate}}
|
||||
</time>
|
||||
<a class="u-url" href="{{.Post.FullUrl}}">#</a>
|
||||
</small>
|
||||
|
|
4
post.go
4
post.go
|
@ -34,6 +34,10 @@ type PostMeta struct {
|
|||
Draft bool `yaml:"draft"`
|
||||
}
|
||||
|
||||
func (pm PostMeta) FormattedDate() string {
|
||||
return pm.Date.Format("02-01-2006 15:04:05")
|
||||
}
|
||||
|
||||
func (pm *PostMeta) UnmarshalYAML(unmarshal func(interface{}) error) error {
|
||||
type T struct {
|
||||
Title string `yaml:"title"`
|
||||
|
|
Loading…
Reference in New Issue