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.
30 lines
511 B
30 lines
511 B
3 years ago
|
package content
|
||
|
|
||
3 years ago
|
import "code.tokarch.uk/mainnika/nikita-tokarch-uk/pkg/ghost/data"
|
||
3 years ago
|
|
||
3 years ago
|
// Index content data
|
||
|
type Index struct {
|
||
|
_ interface{} `template:"index.go.tmpl"`
|
||
3 years ago
|
data.Meta
|
||
|
Pinned []data.Post
|
||
|
Posts []data.Post
|
||
3 years ago
|
}
|
||
3 years ago
|
|
||
|
// 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:"
|
||
|
}
|