Documentation ¶
Index ¶
- Constants
- Variables
- func ContextWithDB(ctx context.Context, db *gorm.DB) context.Context
- func SeoJSComponentsPack() web.ComponentsPack
- type Collection
- func (collection *Collection) Configure(b *presets.Builder, db *gorm.DB)
- func (collection *Collection) GetSEO(obj interface{}) *SEO
- func (collection *Collection) GetSEOByModel(model interface{}) *SEO
- func (collection *Collection) GetSEOByName(name string) *SEO
- func (collection *Collection) NewSettingModelInstance() interface{}
- func (collection *Collection) NewSettingModelSlice() interface{}
- func (collection *Collection) RegisterSEO(obj interface{}) (seo *SEO)
- func (collection *Collection) RegisterSEOByNames(names ...string) *Collection
- func (collection *Collection) RemoveSEO(obj interface{}) *Collection
- func (collection Collection) Render(obj interface{}, req *http.Request) h.HTMLComponent
- func (collection Collection) RenderGlobal(req *http.Request) h.HTMLComponent
- func (collection *Collection) SetDBContextKey(key interface{}) *Collection
- func (collection *Collection) SetGlobalName(name string) *Collection
- func (collection *Collection) SetInherited(b bool) *Collection
- func (collection *Collection) SetSettingModel(s interface{}) *Collection
- type Messages
- type OpenGraphMetadata
- type QorSEOSetting
- func (s QorSEOSetting) GetDescription() string
- func (s QorSEOSetting) GetKeywords() string
- func (s QorSEOSetting) GetName() string
- func (s QorSEOSetting) GetOpenGraphImageFromMediaLibrary() media_library.MediaBox
- func (s QorSEOSetting) GetOpenGraphImageURL() string
- func (s QorSEOSetting) GetOpenGraphMetadata() []OpenGraphMetadata
- func (s QorSEOSetting) GetOpenGraphType() string
- func (s QorSEOSetting) GetOpenGraphURL() string
- func (s QorSEOSetting) GetSEOSetting() Setting
- func (s QorSEOSetting) GetTitle() string
- func (s QorSEOSetting) GetVariables() Variables
- func (s *QorSEOSetting) SetName(name string)
- func (s *QorSEOSetting) SetSEOSetting(setting Setting)
- func (s *QorSEOSetting) SetVariables(setting Variables)
- type QorSEOSettingInterface
- type SEO
- type Setting
- type VSeoBuilder
- func (b *VSeoBuilder) AppendChildren(children ...h.HTMLComponent) (r *VSeoBuilder)
- func (b *VSeoBuilder) Attr(vs ...interface{}) (r *VSeoBuilder)
- func (b *VSeoBuilder) Children(children ...h.HTMLComponent) (r *VSeoBuilder)
- func (b *VSeoBuilder) Class(names ...string) (r *VSeoBuilder)
- func (b *VSeoBuilder) ClassIf(name string, add bool) (r *VSeoBuilder)
- func (b *VSeoBuilder) MarshalHTML(ctx context.Context) (r []byte, err error)
- func (b *VSeoBuilder) Placeholder(v string) (r *VSeoBuilder)
- func (b *VSeoBuilder) PrependChildren(children ...h.HTMLComponent) (r *VSeoBuilder)
- func (b *VSeoBuilder) SetAttr(k string, v interface{})
- func (b *VSeoBuilder) Value(v string) (r *VSeoBuilder)
- type Variables
Constants ¶
const (
I18nSeoKey i18n.ModuleKey = "I18nSeoKey"
)
const (
PermEdit = "perm_seo_edit"
)
Variables ¶
var ( GlobalSEO = "Global SEO" GlobalDB *gorm.DB DBContextKey contextKey = "DB" )
var Messages_en_US = &Messages{
PageTitle: "SEO Setting",
Variable: "Variables Setting",
PageMetadataTitle: "Page Metadata Defaults",
PageMetadataDescription: "These defaults are for pages automatically generated by the system, you can override them on the individual pages.",
Basic: "Basic",
Title: "Title",
Description: "Description",
Keywords: "Keywords",
OpenGraphInformation: "Open Graph Information",
OpenGraphURL: "Open Graph URL",
OpenGraphType: "Open Graph Type",
OpenGraphImageURL: "Open Graph Image URL",
OpenGraphImage: "Open Graph Image",
Save: "Save",
SavedSuccessfully: "Saved successfully",
Seo: "SEO",
UseDefaults: "Use Defaults",
GlobalName: "Global Default SEO",
}
var Messages_zh_CN = &Messages{
PageTitle: "搜索引擎优化设置",
Variable: "变量设置",
PageMetadataTitle: "页面默认值",
PageMetadataDescription: "这些默认值适用于系统自动生成的页面,您可以在各个页面上覆盖它们。",
Basic: "基本信息",
Title: "标题",
Description: "描述",
Keywords: "关键词",
OpenGraphInformation: "OG 信息",
OpenGraphURL: "OG 链接",
OpenGraphType: "OG 类型",
OpenGraphImageURL: "OG 图片链接",
OpenGraphImage: "OG 图片",
Save: "保存",
SavedSuccessfully: "成功保存",
Seo: "搜索引擎优化",
UseDefaults: "使用默认值",
GlobalName: "全局默认SEO",
}
Functions ¶
func SeoJSComponentsPack ¶
func SeoJSComponentsPack() web.ComponentsPack
Types ¶
type Collection ¶
type Collection struct {
// contains filtered or unexported fields
}
Collection will hold registered seo configures and global setting definition and other configures @snippet_begin(SeoCollectionDefinition)
func (*Collection) Configure ¶
func (collection *Collection) Configure(b *presets.Builder, db *gorm.DB)
func (*Collection) GetSEO ¶
func (collection *Collection) GetSEO(obj interface{}) *SEO
GetSEO get a Seo
func (*Collection) GetSEOByModel ¶
func (collection *Collection) GetSEOByModel(model interface{}) *SEO
GetSEOByModel get a seo by model
func (*Collection) GetSEOByName ¶
func (collection *Collection) GetSEOByName(name string) *SEO
GetSEO get a Seo by name
func (*Collection) NewSettingModelInstance ¶
func (collection *Collection) NewSettingModelInstance() interface{}
func (*Collection) NewSettingModelSlice ¶
func (collection *Collection) NewSettingModelSlice() interface{}
func (*Collection) RegisterSEO ¶
func (collection *Collection) RegisterSEO(obj interface{}) (seo *SEO)
RegisterSEO register a seo
func (*Collection) RegisterSEOByNames ¶
func (collection *Collection) RegisterSEOByNames(names ...string) *Collection
RegisterSEOByNames register mutiple seo by names
func (*Collection) RemoveSEO ¶
func (collection *Collection) RemoveSEO(obj interface{}) *Collection
RegisterSEO remove a seo
func (Collection) Render ¶
func (collection Collection) Render(obj interface{}, req *http.Request) h.HTMLComponent
Render render seo tags
func (Collection) RenderGlobal ¶
func (collection Collection) RenderGlobal(req *http.Request) h.HTMLComponent
RenderGlobal render global seo
func (*Collection) SetDBContextKey ¶
func (collection *Collection) SetDBContextKey(key interface{}) *Collection
RegisterDBContextKey register a key to get db from context
func (*Collection) SetGlobalName ¶
func (collection *Collection) SetGlobalName(name string) *Collection
func (*Collection) SetInherited ¶
func (collection *Collection) SetInherited(b bool) *Collection
RegisterVariblesSetting register variables setting
func (*Collection) SetSettingModel ¶
func (collection *Collection) SetSettingModel(s interface{}) *Collection
RegisterVariblesSetting register variables setting
type Messages ¶
type Messages struct { PageTitle string Variable string VariableDescription string PageMetadataTitle string PageMetadataDescription string Basic string Title string Description string Keywords string OpenGraphInformation string OpenGraphURL string OpenGraphType string OpenGraphImageURL string OpenGraphImage string Save string SavedSuccessfully string Seo string UseDefaults string GlobalName string }
type OpenGraphMetadata ¶
OpenGraphMetadata open graph meta data
type QorSEOSetting ¶
type QorSEOSetting struct { Name string `gorm:"primary_key"` Setting Setting Variables Variables `sql:"type:text"` CreatedAt time.Time UpdatedAt time.Time DeletedAt *time.Time `gorm:"index"` }
QorSEOSetting default seo model
func (QorSEOSetting) GetDescription ¶
func (s QorSEOSetting) GetDescription() string
GetDescription get Setting's description
func (QorSEOSetting) GetKeywords ¶
func (s QorSEOSetting) GetKeywords() string
GetKeywords get Setting's keywords
func (QorSEOSetting) GetName ¶
func (s QorSEOSetting) GetName() string
GetName get QorSeoSetting's name
func (QorSEOSetting) GetOpenGraphImageFromMediaLibrary ¶
func (s QorSEOSetting) GetOpenGraphImageFromMediaLibrary() media_library.MediaBox
func (QorSEOSetting) GetOpenGraphImageURL ¶
func (s QorSEOSetting) GetOpenGraphImageURL() string
func (QorSEOSetting) GetOpenGraphMetadata ¶
func (s QorSEOSetting) GetOpenGraphMetadata() []OpenGraphMetadata
func (QorSEOSetting) GetOpenGraphType ¶
func (s QorSEOSetting) GetOpenGraphType() string
func (QorSEOSetting) GetOpenGraphURL ¶
func (s QorSEOSetting) GetOpenGraphURL() string
func (QorSEOSetting) GetSEOSetting ¶
func (s QorSEOSetting) GetSEOSetting() Setting
GetSEOSetting get seo setting
func (QorSEOSetting) GetTitle ¶
func (s QorSEOSetting) GetTitle() string
GetTitle get Setting's title
func (QorSEOSetting) GetVariables ¶
func (s QorSEOSetting) GetVariables() Variables
GetVariablesSetting get variables setting
func (*QorSEOSetting) SetName ¶
func (s *QorSEOSetting) SetName(name string)
SetName set QorSeoSetting's name
func (*QorSEOSetting) SetSEOSetting ¶
func (s *QorSEOSetting) SetSEOSetting(setting Setting)
func (*QorSEOSetting) SetVariables ¶
func (s *QorSEOSetting) SetVariables(setting Variables)
SetVariablesSetting set variables setting
type QorSEOSettingInterface ¶
type QorSEOSettingInterface interface { GetName() string SetName(string) GetSEOSetting() Setting SetSEOSetting(Setting) GetVariables() Variables SetVariables(Variables) GetTitle() string GetDescription() string GetKeywords() string GetOpenGraphURL() string GetOpenGraphType() string GetOpenGraphImageURL() string GetOpenGraphImageFromMediaLibrary() media_library.MediaBox GetOpenGraphMetadata() []OpenGraphMetadata }
QorSEOSettingInterface support customize Seo model @snippet_begin(QorSEOSettingInterface)
type SEO ¶
type SEO struct {
// contains filtered or unexported fields
}
SEO represents a seo object for a page @snippet_begin(SeoDefinition)
func (*SEO) RegisterContextVariables ¶
RegisterContextVariables register context variables
func (*SEO) RegisterSettingVaribles ¶
RegisterSettingVaribles register a setting variable
type Setting ¶
type Setting struct { Title string `gorm:"size:4294967295"` Description string Keywords string OpenGraphURL string OpenGraphType string OpenGraphImageURL string OpenGraphImageFromMediaLibrary media_library.MediaBox OpenGraphMetadata []OpenGraphMetadata EnabledCustomize bool }
Setting defined meta's attributes
func (Setting) HTMLComponent ¶
func (setting Setting) HTMLComponent(tags map[string]string) h.HTMLComponent
type VSeoBuilder ¶
type VSeoBuilder struct {
// contains filtered or unexported fields
}
func VSeo ¶
func VSeo(children ...h.HTMLComponent) (r *VSeoBuilder)
func (*VSeoBuilder) AppendChildren ¶
func (b *VSeoBuilder) AppendChildren(children ...h.HTMLComponent) (r *VSeoBuilder)
func (*VSeoBuilder) Attr ¶
func (b *VSeoBuilder) Attr(vs ...interface{}) (r *VSeoBuilder)
func (*VSeoBuilder) Children ¶
func (b *VSeoBuilder) Children(children ...h.HTMLComponent) (r *VSeoBuilder)
func (*VSeoBuilder) Class ¶
func (b *VSeoBuilder) Class(names ...string) (r *VSeoBuilder)
func (*VSeoBuilder) ClassIf ¶
func (b *VSeoBuilder) ClassIf(name string, add bool) (r *VSeoBuilder)
func (*VSeoBuilder) MarshalHTML ¶
func (b *VSeoBuilder) MarshalHTML(ctx context.Context) (r []byte, err error)
func (*VSeoBuilder) Placeholder ¶
func (b *VSeoBuilder) Placeholder(v string) (r *VSeoBuilder)
func (*VSeoBuilder) PrependChildren ¶
func (b *VSeoBuilder) PrependChildren(children ...h.HTMLComponent) (r *VSeoBuilder)
func (*VSeoBuilder) SetAttr ¶
func (b *VSeoBuilder) SetAttr(k string, v interface{})
func (*VSeoBuilder) Value ¶
func (b *VSeoBuilder) Value(v string) (r *VSeoBuilder)