Started working on pages
This commit is contained in:
parent
e2f159e980
commit
ba12398d2f
30 changed files with 1391 additions and 145 deletions
40
models/bundle.go
Normal file
40
models/bundle.go
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
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 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 int64
|
||||
Body string
|
||||
State PostState
|
||||
Props []byte
|
||||
PublishDate time.Time
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
|
|
@ -10,13 +10,13 @@ const (
|
|||
)
|
||||
|
||||
type Post struct {
|
||||
ID int64
|
||||
SiteID int64
|
||||
OwnerID int64
|
||||
Title string
|
||||
Body string
|
||||
State PostState
|
||||
PostDate time.Time
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
ID int64
|
||||
SiteID int64
|
||||
OwnerID int64
|
||||
Title string
|
||||
Body string
|
||||
State PostState
|
||||
PublishDate time.Time
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,6 @@ type ThemeMeta struct {
|
|||
// Indicates that this theme prefers posts have titles.
|
||||
PreferTitle bool
|
||||
|
||||
// Content directory for "blog" posts
|
||||
PostDir string `json:"post_dir"`
|
||||
// Page bundle for "blog" posts
|
||||
BlogPostBundle string `json:"post_dir"`
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue