wombat/templatestructures/templatestructures.go

69 lines
1.1 KiB
Go
Raw Normal View History

2019-01-01 19:41:03 +01:00
package templatestructures
import (
"time"
)
2019-01-01 19:41:03 +01:00
type Page struct {
Title string
Style string
Script string
Subpages []Subpage
Description string
Content string
Blogname string
Blogdir string
Blogpost bool
PostCollection []Blogpost
Categories []Category
CategoryListings []CategoryListing
TimelineListing []Post
Previous string
Later string
Time string
2019-01-01 19:41:03 +01:00
}
type Subpage struct {
Title string
Description string
Path string
}
type Blogpost struct {
Title string
Link string
Content string
}
type Category struct {
Name string
Path string
}
type CategoryListing struct {
Name string
ASCIIName string
Posts []Post
}
type Post struct {
Content string
Meta Metadata
Filename string
Link string
}
type Metadata struct {
Title string
Date time.Time
Categories []string
}
func (m Metadata) FormattedDate() string {
return m.Date.Format("2006-01-02")
}
2020-10-29 12:01:30 +01:00
func (m Metadata) RFC1123Date() string {
return m.Date.Format(time.RFC1123Z)
}