Methods
# AuthorTags(seoConfig, …params)
AuthorTags adds the twitter:creator tag for story pages
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
seoConfig |
*
|
||
params |
*
|
<repeatable> |
See Generator for other Parameters |
# abstract Generator(seoConfig, config, pageType, data, opts) → {Object}
This is the signature of a generator, though this sample generator is unused
Please see the following list of generators
Parameters:
Name | Type | Description |
---|---|---|
seoConfig |
Object
|
The configuration passed into SEO class. Please see the individual generators for which properties are used |
config |
Object
|
The configuration object. Please see the Config API |
pageType |
string
|
The page type currently being rendered. Usually something like 'home-page' |
data |
Object
|
The data returned by the loadData function |
opts |
Object
|
Option |
url |
string
|
The current URL being served |
A map of all tags. ex: {"og:image": "https://my.domain/image.png"}
Object
# ImageTags(seoConfig, …params)
ImageTags adds the og and twitter images
For a story page, this comes from the hero image. For a collection page (including home and section pages), the image will come from the collection hero image.
If the current story URL contains a cardId in the query parameters, then the title and description will come from card["social-share"]
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
seoConfig |
*
|
||
enableOgTags |
boolean
|
Add og tags for Facebook |
|
enableTwitterCards |
boolean
|
Add twitter tags |
|
fallbackSocialImage |
string
|
Optional. Should be full URL (i.e. include https://). This image will be shown in og:image and twitter:image meta tags for stories having no hero image or alternate hero/social images |
|
params |
*
|
<repeatable> |
See Generator for other Parameters |
# pickImageFromStory()
priority:
- alternate social image
- alternate hero image
- hero image
- "fallbackSocialImage" from seo config
- logo_url from /api/v1/config > theme-attributes
- logo from /api/v1/config > theme-attributes
- undefined (meta tag won't get created)
# StaticTags(seoConfig, …params)
StaticTags puts whatever tags you've passed to it
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
seoConfig |
*
|
||
staticTags |
Object
|
List of tags to be added. ex: |
|
params |
*
|
<repeatable> |
See Generator for other Parameters |
# StoryAmpTags(seoConfig, …params)
StoryAmpTags adds the amphref to stories which support amp.
To disable adding amphref for a specific story, you need to create a story attribute in bold with the slug {disable-amp-for-single-story} and values {true} and {false}. Set its value to "true" in the story which you want to disable amp. Please make sure to name the attributes and values in the exact same way as mentioned attribute slug: "disable-amp-for-single-story" values: "true" , "false"
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
seoConfig |
*
|
||
ampStoryPages |
boolean
|
"public"
|
Should amp story pages be shown for all stories (true), not shown (false), or only be shown for public stories ("public"). Default: true |
|
appendHostToAmpUrl |
boolean
|
If set to true, the url to be appended to the slug is computed based on the currentHostUrl and the domain slug, else the url is taken as the sketches host. Default: false |
|
decodeAmpUrl |
boolean
|
If set to true, the storySlug that goes as the amp href url is decoded, else the storyslug is encoded. Default: false |
|
ignoreAmpHtmlStoryTemplates |
boolean
|
pass all the story templates you want to ignore from add rel="amphtml" tag. Default: ["visual story"] |
|
params |
*
|
<repeatable> |
See Generator for other Parameters |
# StructuredDataTags(seoConfig, …params)
StructuredData adds tags for schema.org's structured data
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
seoConfig |
*
|
||
structuredData |
StructuredDataConfig
|
Please see StructuredDataConfig for a full list of supported options |
|
params |
*
|
<repeatable> |
See Generator for other Parameters |
# TextTags(seoConfig, …params)
TextTags adds the majority of basic tags, such as
- Canonical URLs
- Title and Description
- Keywords
If the current URL contains a cardId in the query parameters, then the title and description will come from card["social-share"]
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
seoConfig |
*
|
||
enableOgTags |
boolean
|
Add og tags for Facebook |
|
enableTwitterCards |
boolean
|
Add twitter tags |
|
enableNews |
boolean
|
Add tags for Google News, like news_keywords |
|
customTags |
Object
|
Add tags for a custom page type. Usually looks like |
|
params |
*
|
<repeatable> |
See Generator for other Parameters |
Type Definitions
# Organization
Options for a schema.org Organization Example
{
name: "Quintype",
url: "http://www.quintype.com/",
logo: "https://quintype.com/logo.png",
sameAs: ["https://www.facebook.com/quintype","https://twitter.com/quintype_in","https://plus.google.com/+quintype","https://www.youtube.com/user/Quintype"]
}
# StructuredDataConfig
Options to StructuredDataTags
Properties:
Name | Type | Description |
---|---|---|
enableBreadcrumbList |
boolean
|
Should breadcrumbs be enabled (default true) |
enableLiveBlog |
boolean
|
Should LiveBlog schema be implemented for live blogs (default false) |
enableVideo |
boolean
|
Should VideoObject be enabled for video stories (default false) |
enableNewsArticle |
boolean
|
"withoutArticleSchema"
|
If set to true, then both Article and NewsArticle schema are implemented. If set to "withoutArticleSchema", then only NewsArticle is implemented |
organization |
Organization
|
The organization to put on the homepage. See Organization for an example |
website |
Website
|
The website and search urls. See Website for an example |
header |
Object
|
Enable WPHeader tag. ex: |
footer |
Object
|
Enable WPFooter tag. ex: |
structuredDataTags |
Array
|
An array of tags describing the publisher. eg: |
isSubscriptionsEnabled |
boolean
|
Enable subscription based schema (default false) |
isShowcaseProduct |
boolean
|
Should product type be showcase (default false, fallback: basic) |
authorSchema |
function
|
Should override author-url in Person schema. We have to pass an array of authors with name and URL Eg: "authorSchema" : (story)=> getAuthorWithUrl(story, config); const getAuthorWithUrl = (story, config) => {
return story.authors.map((author)=>{
return {
name: author.name,
url: |
# Website
Options for a schema.org Website Example
{
url: 'https://www.quintype.com/',
searchpath: 'search?q={q}',
queryinput: 'required name=q',
name: 'Quintype',
headline: 'Quintype - Discover news',
keywords: 'news,quintype'
}