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/frontend/content/index.go

32 lines
519 B

package content
import (
"code.tokarch.uk/mainnika/nikita-tokarch-uk/frontend/ghost"
)
// Index content data
type Index struct {
_ interface{} `template:"index.go.tmpl"`
ghost.Meta
Pinned []ghost.Post
Posts []ghost.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:"
}