Documentation ¶
Index ¶
- Variables
- type Collection
- func (collection *Collection) ConfigureQorResource(res resource.Resourcer)
- func (collection *Collection) GetSEO(name string) *SEO
- func (collection Collection) GetSEOSetting(context *qor.Context, name string, objects ...interface{}) Setting
- 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 MicroContact
- type MicroProduct
- type MicroSearch
- type OpenGraphConfig
- type OpenGraphMetadata
- 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) GetOpenGraphDescription() string
- func (s QorSEOSetting) GetOpenGraphImageFromMediaLibrary() media_library.MediaBox
- func (s QorSEOSetting) GetOpenGraphImageURL() string
- func (s QorSEOSetting) GetOpenGraphMetadata() []OpenGraphMetadata
- func (s QorSEOSetting) GetOpenGraphTitle() string
- func (s QorSEOSetting) GetOpenGraphType() string
- func (s QorSEOSetting) GetOpenGraphURL() string
- func (s QorSEOSetting) GetSEO() *SEO
- func (s QorSEOSetting) GetSEOSetting() Setting
- 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
- func (setting Setting) ConfigureQorMetaBeforeInitialize(meta resource.Metaor)
- func (setting Setting) ConfigureQorResource(res resource.Resourcer)
- func (setting Setting) FormattedHTML(context *qor.Context) template.HTML
- func (setting *Setting) Scan(value interface{}) error
- func (setting Setting) Value() (driver.Value, error)
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 */ )
MicroProductTemplate a bundle of microdata templates
Functions ¶
This section is empty.
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) GetSEOSetting ¶
func (collection Collection) GetSEOSetting(context *qor.Context, name string, objects ...interface{}) Setting
GetSEOSetting return SEO title, keywords and description and open graph settings
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 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 OpenGraphConfig ¶
OpenGraphConfig open graph config
type OpenGraphMetadata ¶
OpenGraphMetadata open graph meta data
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) GetOpenGraphDescription ¶
func (s QorSEOSetting) GetOpenGraphDescription() string
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) GetOpenGraphTitle ¶
func (s QorSEOSetting) GetOpenGraphTitle() string
func (QorSEOSetting) GetOpenGraphType ¶
func (s QorSEOSetting) GetOpenGraphType() string
func (QorSEOSetting) GetOpenGraphURL ¶
func (s QorSEOSetting) GetOpenGraphURL() string
func (QorSEOSetting) GetSEO ¶
func (s QorSEOSetting) GetSEO() *SEO
GetSEO get Setting's SEO configure
func (QorSEOSetting) GetSEOSetting ¶
func (s QorSEOSetting) GetSEOSetting() Setting
GetSEOSetting get seo setting
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) GetSEOSetting() Setting GetGlobalSetting() map[string]string SetGlobalSetting(map[string]string) GetSEOType() string SetSEOType(string) GetIsGlobalSEO() bool SetIsGlobalSEO(bool) GetTitle() string GetDescription() string GetKeywords() string SetCollection(*Collection) GetOpenGraphTitle() string GetOpenGraphDescription() string GetOpenGraphURL() string GetOpenGraphType() string GetOpenGraphImageURL() string GetOpenGraphImageFromMediaLibrary() media_library.MediaBox GetOpenGraphMetadata() []OpenGraphMetadata }
QorSEOSettingInterface support customize Seo model
type SEO ¶
type SEO struct { Name string Varibles []string OpenGraph *OpenGraphConfig 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 OpenGraphTitle string OpenGraphDescription string OpenGraphURL string OpenGraphType string OpenGraphImageURL string OpenGraphImageFromMediaLibrary media_library.MediaBox OpenGraphMetadata []OpenGraphMetadata EnabledCustomize bool GlobalSetting map[string]string }
Setting defined meta's attributes
func (Setting) ConfigureQorMetaBeforeInitialize ¶
ConfigureQorMetaBeforeInitialize configure SEO setting for qor admin
func (Setting) ConfigureQorResource ¶
ConfigureQorResource configure resource for seo setting
func (Setting) FormattedHTML ¶
FormattedHTML return formated seo setting as HTML