schema
defineArticle(input?: Article)
Article
on a WebPage
.SchemaOrgArticle
(see how components work)string
title
key, see defaults.Arrayable<string|ImageObject>
image
key, see defaults.AuthorInput
(conditional)Article
${canonicalUrl}#article
currentRouteMeta.title
(see: route meta resolving)currentRouteMeta.image
(see: route meta resolving)currentRouteMeta.description
(see: route meta resolving)options.defaultLanguage
(see: user Config)currentRouteMeta.datePublished
(see: route meta resolving)currentRouteMeta.dateModified
(see: route meta resolving)AdvertiserContentArticle
NewsArticle
BlogPosting
Report
SatiricalArticle
ScholarlyArticle
SocialMediaPosting
TechArticle
potentialAction
to ReadAction
dateModified
to articles dateModified
datePublished
to articles datePublished
author
to articles author
primaryImageOfPage
to articles first imageSee Global Resolves for full context.
headline
will be cut to a maximum length of 110 without breaking words.thumbnailUrl
will be set to the first imagedateModified
or datePublished
can be resolved from Date objectsdefineArticle({
// will resolve to ISO 8601 format
datePublished: new Date(2020, 10, 1)
})
@type
which isn't Article
will convert it to an array TechArticle
-> ['Article', 'TechArticle']
defineArticle({
// will be resolved as ['Article', 'TechArticle']
'@type': 'TechArticle',
})
See the blog recipe for more examples.
defineArticle({
headline: 'Article Title',
image: '/articles/article-title-image.jpg',
// using identity as the author
})
Add type support for using the routes meta.
defineArticle()
defineArticle({
headline: 'Article Title',
description: 'Article description',
image: '/articles/article-title-image.jpg',
datePublished: new Date(2020, 19, 1),
dateModified: new Date(2020, 19, 1),
// attaching an author when the identity is an organization
author: {
name: 'Harlan Wilton',
url: 'https://harlanzw.com',
}
})
type ValidArticleSubTypes = 'Article' | 'AdvertiserContentArticle' | 'NewsArticle' | 'Report' | 'SatiricalArticle' | 'ScholarlyArticle' | 'SocialMediaPosting' | 'TechArticle'
export interface ArticleSimple extends Thing {
['@type']?: Arrayable<ValidArticleSubTypes>
/**
* The headline of the article (falling back to the title of the WebPage).
* Headlines should not exceed 110 characters.
*/
headline?: string
/**
* A summary of the article (falling back to the page's meta description content).
*/
description?: string
/**
* A reference-by-ID to the WebPage node.
*/
isPartOf?: IdReference
/**
* The time at which the article was originally published, in ISO 8601 format; e.g., 2015-10-31T16:10:29+00:00.
*/
datePublished?: ResolvableDate
/**
* The time at which the article was last modified, in ISO 8601 format; e.g., 2015-10-31T16:10:29+00:00.
*/
dateModified?: ResolvableDate
/**
* A reference-by-ID to the author of the article.
*/
author?: NodeRelations<Identity>
/**
* A reference-by-ID to the publisher of the article.
*/
publisher?: NodeRelations<Identity>
/**
* An array of all videos in the article content, referenced by ID.
*/
video?: NodeRelations<VideoObject>
/**
* An image object or referenced by ID.
* - Must be at least 696 pixels wide.
* - Must be of the following formats+file extensions: .jpg, .png, .gif ,or .webp.
*
* Must have markup of it somewhere on the page.
*/
image?: NodeRelations<ImageObject | string>
/**
* An array of references by ID to comment pieces.
*/
comment?: NodeRelations<Comment>
/**
* A thumbnail image relevant to the Article.
*/
thumbnailUrl?: string
/**
* An integer value of the number of comments associated with the article.
*/
commentCount?: number
/**
* An integer value of the number of words in the article.
*/
wordCount?: number
/**
* An array of keywords which the article has (e.g., ["cats","dogs","cake"]).
*/
keywords?: string[]
/**
* An array of category names which the article belongs to (e.g., ["cats","dogs","cake"]).
*/
articleSection?: string[]
/**
* The language code for the article; e.g., en-GB.
*/
inLanguage?: string
/**
* A SpeakableSpecification object which identifies any content elements suitable for spoken results.
*/
speakable?: unknown
/**
* The year from which the article holds copyright status.
*/
copyrightYear?: string
/**
* A reference-by-ID to the Organization or Person who holds the copyright.
*/
copyrightHolder?: NodeRelations<Identity>
}