weiro/models/sites.go
Leon Mika 9919f3444a feat: add PostsPerPage to Site model and DB provider
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 14:28:50 +11:00

47 lines
797 B
Go

package models
import "time"
type PublishTargetType int
const (
PublishTargetTypeNone PublishTargetType = 0
PublishTargetTypeLocalFS PublishTargetType = 1
PublishTargetTypeNetlify PublishTargetType = 2
)
func ParsePublishTargetType(s string) (PublishTargetType, error) {
switch s {
case "localfs":
return PublishTargetTypeLocalFS, nil
case "netlify":
return PublishTargetTypeNetlify, nil
default:
return PublishTargetTypeNone, nil
}
}
type Site struct {
ID int64
OwnerID int64
GUID string
Created time.Time
Title string
Tagline string
Timezone string
PostsPerPage int
}
type SitePublishTarget struct {
ID int64
SiteID int64
GUID string
Enabled bool
BaseURL string
TargetType string
TargetRef string
TargetKey string
}