Documentation
¶
Index ¶
- Constants
- Variables
- func ErrorMapper(err error) *wo.HTTPError
- func ErrorRenderer[T Resolver](handler func(e T) error, manager PageManager, strategy PageDecoratorStrategy, ...) func(T, *wo.HTTPError)
- func PageFuncMap(urlGenerator URLGenerator) template.FuncMap
- func PageHandler[T Resolver]() func(T) error
- func PageMiddleware[T Resolver](handler func(e T) error, selector PageSelector, strategy PageDecoratorStrategy, ...) func(T) error
- func SiteMiddleware[T Resolver](selector SiteSelector, skippers ...middleware.Skipper[T]) func(T) error
- type Decision
- type DefaultPageManager
- func (m *DefaultPageManager) GetByAlias(ctx context.Context, site *Site, alias string) (*Page, error)
- func (m *DefaultPageManager) GetByID(ctx context.Context, id ID) (*Page, error)
- func (m *DefaultPageManager) GetByPattern(ctx context.Context, site *Site, pattern string) (*Page, error)
- func (m *DefaultPageManager) GetByURL(ctx context.Context, site *Site, url string) (*Page, error)
- type DefaultPageSelector
- type DefaultPageSyncer
- type DefaultSiteSelector
- type DenyPageAuthorizer
- type ErrorPatternFinderFunc
- type Event
- func (e *Event) Content() template.HTML
- func (e *Event) Error() error
- func (e *Event) HasPage() bool
- func (e *Event) HasSite() bool
- func (e *Event) IsDecorable() bool
- func (e *Event) IsGuest() bool
- func (e *Event) IsRoot() bool
- func (e *Event) Page() *Page
- func (e *Event) Pattern() string
- func (e *Event) Render(status int, contentType, template string) error
- func (e *Event) RenderHTML(status int, template string) error
- func (e *Event) Reset(w *wo.Response, r *http.Request, t Theme)
- func (e *Event) SEO() *SEO
- func (e *Event) SetContent(content template.HTML)
- func (e *Event) SetError(err error)
- func (e *Event) SetGuest(guest bool)
- func (e *Event) SetPage(page *Page)
- func (e *Event) SetSite(site *Site)
- func (e *Event) SetStatus(status int)
- func (e *Event) SetTheme(t Theme)
- func (e *Event) Site() *Site
- func (e *Event) Status() int
- func (e *Event) Theme() Theme
- func (e *Event) View(template string, data any) ([]byte, error)
- type HeadLink
- type ID
- type IDGenerator
- type LocalhostSiteStore
- type MemoryPageStore
- func (s *MemoryPageStore) DeleteByID(_ context.Context, ids ...ID) error
- func (s *MemoryPageStore) FindByAlias(_ context.Context, siteID ID, alias string) (*Page, error)
- func (s *MemoryPageStore) FindByID(_ context.Context, id ID) (*Page, error)
- func (s *MemoryPageStore) FindByPattern(_ context.Context, siteID ID, pattern string) (*Page, error)
- func (s *MemoryPageStore) FindByPatterns(_ context.Context, siteID ID, patterns ...string) iter.Seq2[*Page, error]
- func (s *MemoryPageStore) FindByURL(_ context.Context, siteID ID, url string) (*Page, error)
- func (s *MemoryPageStore) GetData() []*Page
- func (s *MemoryPageStore) Save(_ context.Context, pages ...*Page) error
- type MetaTags
- func (m *MetaTags) Append(other *MetaTags)
- func (m *MetaTags) AppendHTTPEquiv(name string, content ...string)
- func (m *MetaTags) AppendName(name string, content ...string)
- func (m *MetaTags) AppendProperty(name string, content ...string)
- func (m *MetaTags) Set(other *MetaTags)
- func (m *MetaTags) SetHTTPEquiv(name string, content ...string)
- func (m *MetaTags) SetName(name string, content ...string)
- func (m *MetaTags) SetProperty(name string, content ...string)
- func (m *MetaTags) With(other *MetaTags) *MetaTags
- type Metadata
- func (m Metadata) Bool(key string) bool
- func (m Metadata) BoolSlice(key string) []bool
- func (m Metadata) Delete(key string)
- func (m Metadata) Duration(key string) time.Duration
- func (m Metadata) Float32(key string) float32
- func (m Metadata) Float64(key string) float64
- func (m Metadata) Get(key string) any
- func (m Metadata) GetOK(key string) (any, bool)
- func (m Metadata) Has(key string) bool
- func (m Metadata) Int(key string) int
- func (m Metadata) Int16(key string) int16
- func (m Metadata) Int32(key string) int32
- func (m Metadata) Int64(key string) int64
- func (m Metadata) Int8(key string) int8
- func (m Metadata) IntSlice(key string) []int
- func (m Metadata) Set(key string, value any)
- func (m Metadata) Slice(key string) []any
- func (m Metadata) Str(key string) string
- func (m Metadata) StrSlice(key string) []string
- func (m Metadata) Time(key string) time.Time
- func (m Metadata) Uint(key string) uint
- func (m Metadata) Uint16(key string) uint16
- func (m Metadata) Uint32(key string) uint32
- func (m Metadata) Uint64(key string) uint64
- func (m Metadata) Uint8(key string) uint8
- type NoopPageDecoratorStrategy
- type Page
- func (p *Page) AbsURL(args ...any) string
- func (p *Page) Copy() *Page
- func (p *Page) FixURL()
- func (p *Page) IsCMS() bool
- func (p *Page) IsDynamic() bool
- func (p *Page) IsError() bool
- func (p *Page) IsHybrid() bool
- func (p *Page) IsInternal() bool
- func (p *Page) SetAlias(alias string)
- func (p *Page) String() string
- type PageAction
- type PageAuthorizer
- type PageConfig
- type PageCreate
- type PageCreateRequest
- type PageDecoratorStrategy
- type PageManager
- type PageSelector
- type PageStore
- type PageSyncer
- type PageSyncerConfig
- type PageURLGenerator
- func (g *PageURLGenerator) Generate(ctx context.Context, site *Site, arg any, args ...any) (string, error)
- func (g *PageURLGenerator) GenerateByAlias(ctx context.Context, site *Site, alias string, args ...any) (string, error)
- func (g *PageURLGenerator) GenerateByID(ctx context.Context, site *Site, id ID, args ...any) (string, error)
- func (g *PageURLGenerator) GenerateByPage(site *Site, page *Page, args ...any) (string, error)
- func (g *PageURLGenerator) GenerateByPattern(ctx context.Context, site *Site, pattern string, args ...any) (string, error)
- func (g *PageURLGenerator) GenerateByURL(ctx context.Context, site *Site, url string, args ...any) (string, error)
- type Patterns
- type Resolver
- type SEO
- func (s *SEO) AddArticleSection(section string)
- func (s *SEO) AddArticleTag(tag string)
- func (s *SEO) AddCanonicalLink(href string)
- func (s *SEO) AddHTMLPrefixAttribute(prefix string)
- func (s *SEO) AddLangAlternate(href, hreflang string)
- func (s *SEO) AddLink(link ...HeadLink)
- func (s *SEO) AddNextLink(href string)
- func (s *SEO) AddPrevLink(href string)
- func (s *SEO) AddTitle(title string)
- func (s *SEO) BodyAttributes() map[string]string
- func (s *SEO) FirstTitle() string
- func (s *SEO) HTMLAttributes() map[string]string
- func (s *SEO) HasBodyAttribute(name string) bool
- func (s *SEO) HasHTMLAttribute(name string) bool
- func (s *SEO) HasHeadAttribute(name string) bool
- func (s *SEO) HasLangAlternate(href string) bool
- func (s *SEO) HeadAttributes() map[string]string
- func (s *SEO) LangAlternates() map[string]string
- func (s *SEO) Links() []HeadLink
- func (s *SEO) MergeMetaTags(metaTags *MetaTags)
- func (s *SEO) MetaTags() *MetaTags
- func (s *SEO) Page(page *Page, args ...any)
- func (s *SEO) RemoveBodyAttribute(name string)
- func (s *SEO) RemoveHTMLAttribute(name string)
- func (s *SEO) RemoveHeadAttribute(name string)
- func (s *SEO) RemoveLangAlternate(href string)
- func (s *SEO) Reset()
- func (s *SEO) ReverseTitle() string
- func (s *SEO) Separator() string
- func (s *SEO) SetArticleExpirationTime(expired time.Time)
- func (s *SEO) SetArticleModifiedTime(updated time.Time)
- func (s *SEO) SetArticlePublishedTime(published time.Time)
- func (s *SEO) SetArticleType()
- func (s *SEO) SetBodyAttribute(name, content string)
- func (s *SEO) SetBodyAttributes(attrs map[string]string)
- func (s *SEO) SetHTMLAttribute(name, content string)
- func (s *SEO) SetHTMLAttributes(attrs map[string]string)
- func (s *SEO) SetHeadAttribute(name, content string)
- func (s *SEO) SetHeadAttributes(attrs map[string]string)
- func (s *SEO) SetLangAlternates(langAlternates map[string]string)
- func (s *SEO) SetLinks(links []HeadLink)
- func (s *SEO) SetOGType(t string)
- func (s *SEO) SetOgURL(url string)
- func (s *SEO) SetSeparator(separator string)
- func (s *SEO) SetTitle(title string)
- func (s *SEO) SetWebsiteType()
- func (s *SEO) Site(site *Site)
- func (s *SEO) Title() string
- type Site
- type SiteSelector
- type SiteStore
- type Status
- type Theme
- type URLGenerator
- type Visibility
Constants ¶
View Source
const ( HeaderXPageDecorable = "X-Page-Decorable" HeaderXPageNotDecorable = "X-Page-Not-Decorable" )
View Source
const ( PageCMS = "_page_cms" PageAliasPrefix = "_page_alias_" PageInternalPrefix = "_page_internal_" PageInternalCreate = PageInternalPrefix + "create" PageErrorPrefix = PageInternalPrefix + "error_" PageErrorForbidden = PageErrorPrefix + "403" PageErrorNotFound = PageErrorPrefix + "404" PageError4xx = PageErrorPrefix + "4xx" PageError5xx = PageErrorPrefix + "5xx" PageCMSPattern = "/{_page_cms...}" HomeHybridPattern = "/{$}" )
View Source
const ( LinkRelAlternate = "alternate" LinkRelAuthor = "author" LinkRelCanonical = "canonical" LinkRelLicense = "license" LinkRelNext = "next" LinkRelPrev = "prev" LinkRelStylesheet = "stylesheet" LinkRelIcon = "icon" )
View Source
const ( ReferrerPolicyNoReferrer = "no-referrer" ReferrerPolicyNoReferrerWhenDowngrade = "no-referrer-when-downgrade" ReferrerPolicyOrigin = "origin" ReferrerPolicyOriginWhenCrossOrigin = "origin-when-cross-origin" ReferrerPolicySameOrigin = "same-origin" ReferrerPolicyStrictOrigin = "strict-origin" ReferrerPolicyUnsafeUrl = "unsafe-url" )
View Source
const DefaultCharset = "UTF-8"
Variables ¶
View Source
var ( ErrSiteNotFound = errors.New("site not found") ErrPageNotFound = errors.New("page not found") ErrPrivatePage = errors.New("page is private") ErrUniqueViolation = errors.New("unique violation") )
View Source
var DefaultPageDecoratorStrategy = &NoopPageDecoratorStrategy{}
View Source
var ErrThemeRequired = errors.New("theme required")
View Source
var SEOFuncMap = template.FuncMap{
"strip_tags": stripTags,
"escape_double_q": escapeDoubleQuotes,
"reverse_title_tag": reverseTitleTag,
"title_tag": titleTag,
"meta_tags": metaTags,
"html_attrs": htmlAttrs,
"head_attrs": headAttrs,
"body_attrs": bodyAttrs,
"lang_alternates": langAlternates,
"head_links": headLinks,
}
Functions ¶
func ErrorMapper ¶
func ErrorRenderer ¶
func ErrorRenderer[T Resolver]( handler func(e T) error, manager PageManager, strategy PageDecoratorStrategy, authorizer PageAuthorizer[T], patternFinder ErrorPatternFinderFunc, logger *slog.Logger, skippers ...middleware.Skipper[T], ) func(T, *wo.HTTPError)
func PageFuncMap ¶
func PageFuncMap(urlGenerator URLGenerator) template.FuncMap
func PageHandler ¶
func PageMiddleware ¶
func PageMiddleware[T Resolver]( handler func(e T) error, selector PageSelector, strategy PageDecoratorStrategy, authorizer PageAuthorizer[T], skippers ...middleware.Skipper[T], ) func(T) error
func SiteMiddleware ¶
func SiteMiddleware[T Resolver](selector SiteSelector, skippers ...middleware.Skipper[T]) func(T) error
Types ¶
type DefaultPageManager ¶
type DefaultPageManager struct {
// contains filtered or unexported fields
}
func NewPageManager ¶
func NewPageManager(store PageStore) *DefaultPageManager
func (*DefaultPageManager) GetByAlias ¶
func (*DefaultPageManager) GetByPattern ¶
type DefaultPageSelector ¶
type DefaultPageSelector struct {
// contains filtered or unexported fields
}
func NewPageSelector ¶
func NewPageSelector(manager PageManager) *DefaultPageSelector
type DefaultPageSyncer ¶
type DefaultPageSyncer struct {
// contains filtered or unexported fields
}
func NewDefaultPageSyncer ¶
func NewDefaultPageSyncer( cfg PageSyncerConfig, store PageStore, generator IDGenerator, patterns Patterns, strategy PageDecoratorStrategy, ) *DefaultPageSyncer
type DefaultSiteSelector ¶
type DefaultSiteSelector struct {
// contains filtered or unexported fields
}
func NewSiteSelector ¶
type DenyPageAuthorizer ¶
type DenyPageAuthorizer[T Resolver] struct{}
func (DenyPageAuthorizer[T]) Authorize ¶
func (DenyPageAuthorizer[T]) Authorize(T, PageAction) (Decision, error)
type ErrorPatternFinderFunc ¶
func ErrorPatternFinder ¶
func ErrorPatternFinder() ErrorPatternFinderFunc
type HeadLink ¶
type HeadLink struct {
// CrossOrigin Specifies how the element handles cross-origin requests
CrossOrigin string
// Href Specifies the location of the linked document
Href string
// HrefLang Specifies the language of the text in the linked document
HrefLang string
// Media Specifies on what device the linked document will be displayed
Media string
// Rel REQUIRED Specifies the relationship between the current document and the linked document
Rel string
// Sizes Specifies the size of the linked resource. Only for rel="icon"
Sizes string
// Title Defines a preferred or an alternate stylesheet
Title string
// Type Specifies the media type of the linked document
Type string
}
type LocalhostSiteStore ¶
type LocalhostSiteStore struct{}
func NewLocalhostSiteStore ¶
func NewLocalhostSiteStore() *LocalhostSiteStore
func (*LocalhostSiteStore) FindPublished ¶
type MemoryPageStore ¶
type MemoryPageStore struct {
// contains filtered or unexported fields
}
func NewMemoryPageStore ¶
func NewMemoryPageStore() *MemoryPageStore
func (*MemoryPageStore) DeleteByID ¶
func (s *MemoryPageStore) DeleteByID(_ context.Context, ids ...ID) error
func (*MemoryPageStore) FindByAlias ¶
func (*MemoryPageStore) FindByPattern ¶
func (*MemoryPageStore) FindByPatterns ¶
func (*MemoryPageStore) GetData ¶
func (s *MemoryPageStore) GetData() []*Page
GetData returns a copy of the data slice for testing purposes. This method provides thread-safe access to the internal data.
type MetaTags ¶
type MetaTags struct {
Charset string `json:"charset,omitempty" yaml:"charset,omitempty"`
Name map[string][]string `json:"name,omitempty" yaml:"name,omitempty"`
Property map[string][]string `json:"property,omitempty" yaml:"property,omitempty"`
HTTPEquiv map[string][]string `json:"httpEquiv,omitempty" yaml:"httpEquiv,omitempty"`
}
func NewMetaTags ¶
func (*MetaTags) AppendHTTPEquiv ¶
func (*MetaTags) AppendName ¶
func (*MetaTags) AppendProperty ¶
func (*MetaTags) SetHTTPEquiv ¶
func (*MetaTags) SetProperty ¶
type Metadata ¶
func NewMetadata ¶
type NoopPageDecoratorStrategy ¶
type NoopPageDecoratorStrategy struct{}
func (*NoopPageDecoratorStrategy) IsDecorable ¶
func (*NoopPageDecoratorStrategy) IsPatternDecorable ¶
func (*NoopPageDecoratorStrategy) IsURIDecorable ¶
type Page ¶
type Page struct {
ID ID `json:"id,omitempty" yaml:"id,omitempty"`
SiteID ID `json:"siteID,omitempty" yaml:"siteID,omitempty"`
Site *Site `json:"site,omitempty" yaml:"site,omitempty"`
ParentID *ID `json:"parentID,omitempty" yaml:"parentID,omitempty"`
Parent *Page `json:"parent,omitempty" yaml:"parent,omitempty"`
Children []*Page `json:"children,omitempty" yaml:"children,omitempty"`
Created time.Time `json:"created,omitzero" yaml:"created,omitempty"`
Updated time.Time `json:"updated,omitzero" yaml:"updated,omitempty"`
Status Status `json:"status,omitempty" yaml:"status,omitempty"`
Visibility Visibility `json:"visibility,omitempty" yaml:"visibility,omitempty"`
MetaTags *MetaTags `json:"metaTags,omitempty" yaml:"metaTags,omitempty"`
Metadata Metadata `json:"metadata,omitempty" yaml:"metadata,omitempty"`
Header map[string][]string `json:"header,omitempty" yaml:"header,omitempty"`
Name string `json:"name,omitempty" yaml:"name,omitempty"`
Title string `json:"title,omitempty" yaml:"title,omitempty"`
Pattern string `json:"pattern,omitempty" yaml:"pattern,omitempty"`
Alias string `json:"alias,omitempty" yaml:"alias,omitempty"`
Slug string `json:"slug,omitempty" yaml:"slug,omitempty"`
URL string `json:"url,omitempty" yaml:"url,omitempty"`
CustomURL string `json:"customURL,omitempty" yaml:"customURL,omitempty"`
Template string `json:"template,omitempty" yaml:"template,omitempty"`
Position int `json:"position,omitempty" yaml:"position,omitempty"`
Decorate bool `json:"decorate,omitempty" yaml:"decorate,omitempty"`
}
func (*Page) IsInternal ¶
type PageAction ¶
type PageAction int8
const ( ViewDraftPage PageAction = iota + 1 ViewPrivatePage CreatePage )
func (PageAction) String ¶
func (a PageAction) String() string
type PageAuthorizer ¶
type PageAuthorizer[T Resolver] interface { Authorize(e T, action PageAction) (Decision, error) }
type PageConfig ¶
type PageConfig struct {
ParentID *ID `json:"parentID,omitempty" yaml:"parentID,omitempty"`
Template *string `json:"template,omitempty" yaml:"template,omitempty"`
Position *int `json:"position,omitempty" yaml:"position,omitempty"`
Decorate *bool `json:"decorate,omitempty" yaml:"decorate,omitempty"`
Status *Status `json:"status,omitempty" yaml:"status,omitempty"`
Visibility *Visibility `json:"visibility,omitempty" yaml:"visibility,omitempty"`
MetaTags *MetaTags `json:"metaTags,omitempty" yaml:"metaTags,omitempty"`
Metadata Metadata `json:"metadata,omitempty" yaml:"metadata,omitempty"`
Header map[string][]string `json:"header,omitempty" yaml:"header,omitempty"`
}
type PageCreate ¶
type PageCreate[T Resolver] struct { // contains filtered or unexported fields }
func NewPageCreate ¶
func (*PageCreate[T]) Handle ¶
func (h *PageCreate[T]) Handle(e T) error
type PageCreateRequest ¶
type PageCreateRequest struct {
URL string `json:"url,omitempty" form:"url,omitempty"`
Template string `json:"template,omitempty" form:"template,omitempty"`
Title string `json:"title,omitempty" form:"title,omitempty"`
}
func (*PageCreateRequest) Validate ¶
func (r *PageCreateRequest) Validate() error
type PageDecoratorStrategy ¶
type PageManager ¶
type PageManager interface {
GetByID(ctx context.Context, id ID) (*Page, error)
GetByURL(ctx context.Context, site *Site, url string) (*Page, error)
GetByPattern(ctx context.Context, site *Site, pattern string) (*Page, error)
GetByAlias(ctx context.Context, site *Site, alias string) (*Page, error)
}
type PageSelector ¶
type PageStore ¶
type PageStore interface {
FindByID(ctx context.Context, id ID) (*Page, error)
FindByURL(ctx context.Context, siteID ID, url string) (*Page, error)
FindByPattern(ctx context.Context, siteID ID, pattern string) (*Page, error)
FindByPatterns(ctx context.Context, siteID ID, patterns ...string) iter.Seq2[*Page, error]
FindByAlias(ctx context.Context, siteID ID, alias string) (*Page, error)
Save(ctx context.Context, pages ...*Page) error
}
type PageSyncerConfig ¶
type PageSyncerConfig struct {
DefaultPage *PageConfig `json:"defaultPage,omitempty" yaml:"defaultPage,omitempty"`
DefaultPatterns map[string]*PageConfig `json:"defaultPatterns,omitempty" yaml:"defaultPatterns,omitempty"`
}
func (*PageSyncerConfig) SetDefaults ¶
func (c *PageSyncerConfig) SetDefaults()
type PageURLGenerator ¶
type PageURLGenerator struct {
// contains filtered or unexported fields
}
func NewPageURLGenerator ¶
func NewPageURLGenerator(manager PageManager) *PageURLGenerator
func (*PageURLGenerator) GenerateByAlias ¶
func (*PageURLGenerator) GenerateByID ¶
func (*PageURLGenerator) GenerateByPage ¶
func (*PageURLGenerator) GenerateByPattern ¶
func (*PageURLGenerator) GenerateByURL ¶
type Resolver ¶
type Resolver interface {
wo.Resolver
// Scheme returns the HTTP protocol scheme, `http` or `https`.
Scheme() string
BindBody(dst any) error
Site() *Site
SetSite(site *Site)
HasSite() bool
Page() *Page
SetPage(page *Page)
HasPage() bool
Status() int
SetStatus(status int)
SetError(err error)
SetContent(content template.HTML)
IsGuest() bool
IsDecorable() bool
NoContent(status int) error
Render(status int, contentType, template string) error
}
type SEO ¶
type SEO struct {
// contains filtered or unexported fields
}
func (*SEO) AddArticleSection ¶
func (*SEO) AddArticleTag ¶
func (*SEO) AddCanonicalLink ¶
func (*SEO) AddHTMLPrefixAttribute ¶
func (*SEO) AddLangAlternate ¶
func (*SEO) AddNextLink ¶
func (*SEO) AddPrevLink ¶
func (*SEO) BodyAttributes ¶
func (*SEO) FirstTitle ¶
func (*SEO) HTMLAttributes ¶
func (*SEO) HasBodyAttribute ¶
func (*SEO) HasHTMLAttribute ¶
func (*SEO) HasHeadAttribute ¶
func (*SEO) HasLangAlternate ¶
func (*SEO) HeadAttributes ¶
func (*SEO) LangAlternates ¶
func (*SEO) MergeMetaTags ¶
func (*SEO) RemoveBodyAttribute ¶
func (*SEO) RemoveHTMLAttribute ¶
func (*SEO) RemoveHeadAttribute ¶
func (*SEO) RemoveLangAlternate ¶
func (*SEO) ReverseTitle ¶
func (*SEO) SetArticleExpirationTime ¶
func (*SEO) SetArticleModifiedTime ¶
func (*SEO) SetArticlePublishedTime ¶
func (*SEO) SetArticleType ¶
func (s *SEO) SetArticleType()
func (*SEO) SetBodyAttribute ¶
func (*SEO) SetBodyAttributes ¶
func (*SEO) SetHTMLAttribute ¶
func (*SEO) SetHTMLAttributes ¶
func (*SEO) SetHeadAttribute ¶
func (*SEO) SetHeadAttributes ¶
func (*SEO) SetLangAlternates ¶
func (*SEO) SetSeparator ¶
func (*SEO) SetWebsiteType ¶
func (s *SEO) SetWebsiteType()
type Site ¶
type Site struct {
ID ID `json:"id,omitempty" yaml:"id,omitempty"`
Created time.Time `json:"created,omitzero" yaml:"created,omitempty"`
Updated time.Time `json:"updated,omitzero" yaml:"updated,omitempty"`
Status Status `json:"status,omitempty" yaml:"status,omitempty"`
MetaTags *MetaTags `json:"metaTags,omitempty" yaml:"metaTags,omitempty"`
Metadata Metadata `json:"metadata,omitempty" yaml:"metadata,omitempty"`
Name string `json:"name,omitempty" yaml:"name,omitempty"`
Title string `json:"title,omitempty" yaml:"title,omitempty"`
Separator string `json:"separator,omitempty" yaml:"separator,omitempty"`
Locale string `json:"locale,omitempty" yaml:"locale,omitempty"`
Timezone string `json:"timezone,omitempty" yaml:"timezone,omitempty"`
Countries []string `json:"countries,omitempty" yaml:"countries,omitempty"`
Scheme string `json:"scheme,omitempty" yaml:"scheme,omitempty"`
Host string `json:"host,omitempty" yaml:"host,omitempty"`
RelativePath string `json:"relativePath,omitempty" yaml:"relativePath,omitempty"`
IsDefault bool `json:"isDefault,omitempty" yaml:"isDefault,omitempty"`
// contains filtered or unexported fields
}
func (*Site) IsLocalhost ¶
type SiteSelector ¶
type URLGenerator ¶
type Visibility ¶
type Visibility int8
const ( Private Visibility = iota Public )
func VisibilityFromString ¶
func VisibilityFromString(s string) Visibility
func (Visibility) String ¶
func (v Visibility) String() string
Source Files
¶
- errors.go
- event.go
- id.go
- metadata.go
- metatags.go
- page.go
- page_authorizer.go
- page_create.go
- page_decorator_strategy.go
- page_funcmap.go
- page_handler.go
- page_manager.go
- page_middleware.go
- page_selector.go
- page_store.go
- page_syncer.go
- page_urlgenerator.go
- seo.go
- seo_funcmap.go
- site.go
- site_middleware.go
- site_selector.go
- site_store.go
- status.go
- theme.go
- visibility.go
Click to show internal directories.
Click to hide internal directories.