2019-01-01 19:41:03 +01:00
|
|
|
package templatestructures
|
|
|
|
|
2020-05-28 21:52:50 +02:00
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
2019-01-01 19:41:03 +01:00
|
|
|
type Page struct {
|
2020-05-28 21:52:50 +02:00
|
|
|
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
|
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
|
|
|
|
}
|
2020-05-28 21:52:50 +02:00
|
|
|
|
|
|
|
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)
|
|
|
|
}
|