wombat/templatestructures/templatestructures.go

69 lines
1.1 KiB
Go

package templatestructures
import (
"time"
)
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
}
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")
}
func (m Metadata) RFC1123Date() string {
return m.Date.Format(time.RFC1123Z)
}