Documentation ¶
Index ¶
- Variables
- func ECollection(name string) string
- type Collection
- func (collection *Collection) ConfigureQorResource(res resource.Resourcer)
- func (collection *Collection) GetSEO(name string) *SEO
- func (collection *Collection) RegisterGlobalVaribles(s interface{})
- func (collection *Collection) RegisterSEO(seo *SEO)
- func (collection Collection) Render(context *qor.Context, name string, objects ...interface{}) template.HTML
- func (collection *Collection) SEOSettingURL(name string) string
- type CollectionEvent
- type MicroContact
- type MicroProduct
- type MicroSearch
- type Plugin
- type QorSEOSetting
- func (s QorSEOSetting) GetDescription() string
- func (s QorSEOSetting) GetGlobalSetting() map[string]string
- func (s QorSEOSetting) GetIsGlobalSEO() bool
- func (s QorSEOSetting) GetKeywords() string
- func (s QorSEOSetting) GetName() string
- func (s QorSEOSetting) GetSEO() *SEO
- func (s QorSEOSetting) GetSEOType() string
- func (s QorSEOSetting) GetTitle() string
- func (s *QorSEOSetting) SetCollection(collection *Collection)
- func (s *QorSEOSetting) SetGlobalSetting(globalSetting map[string]string)
- func (s *QorSEOSetting) SetIsGlobalSEO(isGlobal bool)
- func (s *QorSEOSetting) SetName(name string)
- func (s *QorSEOSetting) SetSEOType(t string)
- type QorSEOSettingInterface
- type SEO
- type Setting
Constants ¶
This section is empty.
Variables ¶
var ( MicroProductTemplate = `` /* 992-byte string literal not displayed */ MicroContactTemplate = `` /* 273-byte string literal not displayed */ MicroSearchTemplate = `` /* 262-byte string literal not displayed */ )
var E_SEO_COLLECTION = PREFIX + ".collection"
var PREFIX string
Functions ¶
func ECollection ¶
Types ¶
type Collection ¶
type Collection struct { Name string SettingResource *admin.Resource // contains filtered or unexported fields }
Collection will hold registered seo configures and global setting definition and other configures
func (*Collection) ConfigureQorResource ¶
func (collection *Collection) ConfigureQorResource(res resource.Resourcer)
ConfigureQorResource configure seoCollection for qor admin
func (*Collection) GetSEO ¶
func (collection *Collection) GetSEO(name string) *SEO
GetSeo get a Seo by name
func (*Collection) RegisterGlobalVaribles ¶
func (collection *Collection) RegisterGlobalVaribles(s interface{})
RegisterGlobalVaribles register global setting struct and will represents as 'Site-wide Settings' part in admin
func (*Collection) RegisterSEO ¶
func (collection *Collection) RegisterSEO(seo *SEO)
RegisterSEO register a seo
func (Collection) Render ¶
func (collection Collection) Render(context *qor.Context, name string, objects ...interface{}) template.HTML
Render render SEO Setting
func (*Collection) SEOSettingURL ¶
func (collection *Collection) SEOSettingURL(name string) string
SEOSettingURL get setting inline edit url by name
type CollectionEvent ¶
type CollectionEvent struct { plug.PluginEventInterface Collection *Collection CollectionName string PluginEvent plug.PluginEventInterface }
type MicroContact ¶
MicroContact micro search definition, ref: https://developers.google.com/structured-data/customize/contact-points
func (MicroContact) Render ¶
func (contact MicroContact) Render() template.HTML
Render render micro contact structured data
type MicroProduct ¶
type MicroProduct struct { Name string Image string Description string BrandName string SKU string RatingValue float32 ReviewCount int PriceCurrency string Price float64 PriceValidUntil string SellerName string }
MicroProduct micro product definition, ref: https://developers.google.com/structured-data/rich-snippets/products
func (MicroProduct) Render ¶
func (product MicroProduct) Render() template.HTML
Render render micro product structured data
type MicroSearch ¶
MicroSearch micro search definition, ref: https://developers.google.com/structured-data/slsb-overview e.g.
Target: https://query.example-petstore.com/search?q={keyword}
func (MicroSearch) FormattedQueryInput ¶
func (search MicroSearch) FormattedQueryInput() string
FormattedQueryInput format query input
func (MicroSearch) Render ¶
func (search MicroSearch) Render() template.HTML
Render render micro search structured data
type Plugin ¶
type Plugin struct { plug.EventDispatcher CollectionNames []string }
func (*Plugin) OnRegister ¶
func (p *Plugin) OnRegister()
func (*Plugin) RequireOptions ¶
type QorSEOSetting ¶
type QorSEOSetting struct { Name string `gorm:"primary_key"` Setting Setting IsGlobalSEO bool CreatedAt time.Time UpdatedAt time.Time DeletedAt *time.Time `gorm:"index"` // contains filtered or unexported fields }
QorSEOSetting default seo model
func (QorSEOSetting) GetDescription ¶
func (s QorSEOSetting) GetDescription() string
GetDescription get Setting's description
func (QorSEOSetting) GetGlobalSetting ¶
func (s QorSEOSetting) GetGlobalSetting() map[string]string
GetGlobalSetting get QorSeoSetting's globalSetting
func (QorSEOSetting) GetIsGlobalSEO ¶
func (s QorSEOSetting) GetIsGlobalSEO() bool
GetIsGlobalSEO get QorSEOSetting's isGlobal
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) GetSEO ¶
func (s QorSEOSetting) GetSEO() *SEO
GetSEO get Setting's SEO configure
func (QorSEOSetting) GetSEOType ¶
func (s QorSEOSetting) GetSEOType() string
GetSeoType get QorSeoSetting's type
func (QorSEOSetting) GetTitle ¶
func (s QorSEOSetting) GetTitle() string
GetTitle get Setting's title
func (*QorSEOSetting) SetCollection ¶
func (s *QorSEOSetting) SetCollection(collection *Collection)
SetCollection set Setting's collection
func (*QorSEOSetting) SetGlobalSetting ¶
func (s *QorSEOSetting) SetGlobalSetting(globalSetting map[string]string)
SetGlobalSetting set QorSeoSetting's globalSetting
func (*QorSEOSetting) SetIsGlobalSEO ¶
func (s *QorSEOSetting) SetIsGlobalSEO(isGlobal bool)
SetIsGlobalSEO set QorSeoSetting's isGlobal
func (*QorSEOSetting) SetName ¶
func (s *QorSEOSetting) SetName(name string)
SetName set QorSeoSetting's name
func (*QorSEOSetting) SetSEOType ¶
func (s *QorSEOSetting) SetSEOType(t string)
SetSeoType set QorSeoSetting's type
type QorSEOSettingInterface ¶
type QorSEOSettingInterface interface { GetName() string SetName(string) GetGlobalSetting() map[string]string SetGlobalSetting(map[string]string) GetSEOType() string SetSEOType(string) GetIsGlobalSEO() bool SetIsGlobalSEO(bool) GetTitle() string GetDescription() string GetKeywords() string SetCollection(*Collection) }
QorSEOSettingInterface support customize Seo model
type SEO ¶
type SEO struct { Name string Varibles []string Context func(...interface{}) map[string]string // contains filtered or unexported fields }
SEO represents a seo object for a page
type Setting ¶
type Setting struct { Title string `gorm:"size:4294967295"` Description string Keywords string Type string EnabledCustomize bool GlobalSetting map[string]string }
Setting defined meta's attributes
func (Setting) ConfigureQorMetaBeforeInitialize ¶
ConfigureQorMetaBeforeInitialize configure SEO setting for qor admin