hugo-cms/models/page.go

55 lines
984 B
Go
Raw Permalink Normal View History

2025-02-16 00:43:22 +00:00
package models
import "time"
const (
RootBundleName = "_root"
)
// NameProvenance encodes where the name came from, whether it was set by the user or autogenerated in some way
type NameProvenance int
const (
UserNameProvenance NameProvenance = iota
TitleNameProvenance NameProvenance = iota
DateNameProvenance NameProvenance = iota
)
type PageRole int
const (
NormalPageRole PageRole = iota
IndexPageRole
)
2025-02-16 00:43:22 +00:00
type Bundle struct {
ID int64
SiteID int64
Name string
CreatedAt time.Time
UpdatedAt time.Time
}
type Page struct {
ID int64
SiteID int64
BundleID int64
Name string
NameProvenance NameProvenance
Title string
Role PageRole
2025-02-16 00:43:22 +00:00
Body string
State PostState
PageTypeID int64
2025-02-16 00:43:22 +00:00
Props []byte
PublishDate time.Time
CreatedAt time.Time
UpdatedAt time.Time
}
type BundleInfo struct {
BundleID int64
PageCount int
IndexPageID int64
}