UNPKG

@forge42/seo-tools

Version:

Framework agnostic set of helpers designed to help you create, maintain and develop your SEO

1 lines 1.06 kB
{"version":3,"sources":["../../src/structured-data/article.ts"],"sourcesContent":["import type { Article, WithContext } from \"schema-dts\"\r\n\r\n/**\r\n * This helper is used to generate an article ld+json structured data object.\r\n *\r\n *\r\n * Find more information about the article schema here:\r\n * https://developers.google.com/search/docs/appearance/structured-data/article\r\n *\r\n * Article objects must be based on one of the following schema.org types: Article, NewsArticle, BlogPosting.\r\n * - Article: https://schema.org/Article\r\n * - NewsArticle: https://schema.org/NewsArticle\r\n * - BlogPosting: https://schema.org/BlogPosting\r\n *\r\n * @param article Article object\r\n * @returns Article object to be used in head via json-ld script tag\r\n */\r\nexport const article = (article: Article): WithContext<Article> => {\r\n\treturn {\r\n\t\t\"@context\": \"https://schema.org\",\r\n\t\t...article,\r\n\t}\r\n}\r\n\r\nexport type { Article }\r\n"],"mappings":"AAiBO,IAAMA,EAAWA,IAChB,CACN,WAAY,qBACZ,GAAGA,CACJ","names":["article"]}