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