formatted date

This commit is contained in:
Niko Abeler 2022-09-11 17:34:50 +02:00
parent 9ca50eafff
commit 968fb30f53
2 changed files with 5 additions and 1 deletions

View File

@ -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>

View File

@ -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"`