You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nikita-tokarch-uk/pkg/content/index.go

30 lines
511 B

package content
import "code.tokarch.uk/mainnika/nikita-tokarch-uk/pkg/ghost/data"
// Index content data
type Index struct {
_ interface{} `template:"index.go.tmpl"`
data.Meta
Pinned []data.Post
Posts []data.Post
}
// Title returns index title
func (i Index) Title() string {
if len(i.Pinned) > 0 {
return i.Pinned[0].Title
}
if len(i.Posts) > 0 {
return i.Posts[0].Title
}
return "UNKNOWN:"
}
// Description returns index description
func (i Index) Description() string {
return "TODO:"
}