@quintype/seo 1.46.3 → 1.46.4-recipe-schema.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -757,9 +757,9 @@ function generateLiveBlogPostingData(structuredData = {}, story = {}, publisherC
757
757
  function getEmbedUrl(cards) {
758
758
  const playerUrlMapping = {
759
759
  "dailymotion-embed-script": "dailymotion-url",
760
- "instagram": "instagram-url",
760
+ instagram: "instagram-url",
761
761
  "facebook-video": "facebook-url",
762
- "tweet": "tweet-url",
762
+ tweet: "tweet-url",
763
763
  "vimeo-video": "vimeo-url",
764
764
  "brightcove-video": "player-url"
765
765
  };
@@ -772,7 +772,8 @@ function getEmbedUrl(cards) {
772
772
  if (elem.metadata && elem.metadata[playerUrlField]) {
773
773
  return elem.metadata[playerUrlField];
774
774
  }
775
- } if (elem.type === "youtube-video" && elem.subtype === null) {
775
+ }
776
+ if (elem.type === "youtube-video" && elem.subtype === null) {
776
777
  if (elem.url) {
777
778
  return elem.url;
778
779
  }
@@ -937,9 +938,9 @@ function StructuredDataTags({ structuredData = {} }, config, pageType, response
937
938
  const isStructuredDataEmpty = Object.keys(structuredData).length === 0;
938
939
  const enableBreadcrumbList = get__default["default"](structuredData, ["enableBreadcrumbList"], true);
939
940
  const structuredDataTags = get__default["default"](structuredData, ["structuredDataTags"], []);
940
-
941
941
  let articleData = {};
942
942
 
943
+ // generateRecipePageSchema(publisherConfig, response.data, url, story);
943
944
  if (!isStructuredDataEmpty) {
944
945
  articleData = generateArticleData(structuredData, story, publisherConfig, timezone);
945
946
  structuredDataTags.map(type => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quintype/seo",
3
- "version": "1.46.3",
3
+ "version": "1.46.4-recipe-schema.0",
4
4
  "description": "SEO Modules for Quintype",
5
5
  "main": "dist/index.cjs.js",
6
6
  "repository": "https://github.com/quintype/quintype-node-seo",
@@ -151,3 +151,47 @@ export function generateAuthorPageSchema(publisherConfig, data, url) {
151
151
  },
152
152
  };
153
153
  }
154
+
155
+ export function generateRecipePageSchema(publisherConfig, data, url, story) {
156
+ const sketchesHost = publisherConfig["sketches-host"];
157
+ const publisherName = getTitle(publisherConfig);
158
+ const authorHREF = url["href"];
159
+ const authorURL = `${sketchesHost}${authorHREF}`;
160
+ const authorName = get(data, ["author", "name"], "");
161
+ // console.log("generateRecipePageSchema --->", { publisherConfig, data, url, story });
162
+ return {
163
+ "@context": "https://schema.org/",
164
+ "@type": "Recipe",
165
+ name: story.headline,
166
+ url: story.url,
167
+ author: {
168
+ "@type": "Person",
169
+ name: story["author-name"],
170
+ },
171
+ image: { "@type": "ImageObject", url: story.recipeUrl },
172
+ description: story.description,
173
+ recipeIngredient: ["1 cup sugar", "2 cups flour", "1 cup chocolate chips"],
174
+ recipeInstructions: [
175
+ {
176
+ "@type": "HowToStep",
177
+ text: "Preheat the oven to 350 degrees F.",
178
+ },
179
+ {
180
+ "@type": "HowToStep",
181
+ text: "Mix the sugar and flour.",
182
+ },
183
+ {
184
+ "@type": "HowToStep",
185
+ text: "Add the chocolate chips and bake for 10 minutes.",
186
+ },
187
+ ],
188
+ recipeYield: "24 cookies",
189
+ prepTime: "PT20M",
190
+ cookTime: "PT10M",
191
+ totalTime: "PT30M",
192
+ nutrition: {
193
+ "@type": "NutritionInformation",
194
+ calories: "200 calories",
195
+ },
196
+ };
197
+ }
@@ -265,11 +265,11 @@ function generateLiveBlogPostingData(structuredData = {}, story = {}, publisherC
265
265
  function getEmbedUrl(cards) {
266
266
  const playerUrlMapping = {
267
267
  "dailymotion-embed-script": "dailymotion-url",
268
- "instagram": "instagram-url",
268
+ instagram: "instagram-url",
269
269
  "facebook-video": "facebook-url",
270
- "tweet": "tweet-url",
270
+ tweet: "tweet-url",
271
271
  "vimeo-video": "vimeo-url",
272
- "brightcove-video": "player-url"
272
+ "brightcove-video": "player-url",
273
273
  };
274
274
 
275
275
  for (const card of cards) {
@@ -280,7 +280,7 @@ function getEmbedUrl(cards) {
280
280
  if (elem.metadata && elem.metadata[playerUrlField]) {
281
281
  return elem.metadata[playerUrlField];
282
282
  }
283
- };
283
+ }
284
284
  if (elem.type === "youtube-video" && elem.subtype === null) {
285
285
  if (elem.url) {
286
286
  return elem.url;
@@ -446,9 +446,9 @@ export function StructuredDataTags({ structuredData = {} }, config, pageType, re
446
446
  const isStructuredDataEmpty = Object.keys(structuredData).length === 0;
447
447
  const enableBreadcrumbList = get(structuredData, ["enableBreadcrumbList"], true);
448
448
  const structuredDataTags = get(structuredData, ["structuredDataTags"], []);
449
-
450
449
  let articleData = {};
451
450
 
451
+ // generateRecipePageSchema(publisherConfig, response.data, url, story);
452
452
  if (!isStructuredDataEmpty) {
453
453
  articleData = generateArticleData(structuredData, story, publisherConfig, timezone);
454
454
  structuredDataTags.map((type) => {