64 lines
1.0 KiB
Go
64 lines
1.0 KiB
Go
package templatestructures
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
type Page struct {
|
|
Title string
|
|
Style 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")
|
|
}
|