@quintype/seo 1.50.3 → 1.50.4-beta.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
@@ -1366,7 +1366,7 @@ function buildTagsFromStory(config, story, url = {}, data = {}) {
1366
1366
  const keywords = (customSeo.keywords || seo["meta-keywords"] || (story.tags || []).map(tag => tag.name)).join(",");
1367
1367
  const ogUrl = customSeo.ogUrl || lodash.get(seo, ["og", "url"]) || storyUrl;
1368
1368
  const getOgTitle = customSeo.ogTitle || lodash.get(story, ["alternative", "social", "default", "headline"], story.headline) || story.headline;
1369
- const ogDescription = customSeo.ogDescription || story.summary;
1369
+ const ogDescription = customSeo.ogDescription || seo["meta-description"] || story.summary;
1370
1370
  const canonicalUrl = customSeo.canonicalUrl || story["canonical-url"] || storyUrl;
1371
1371
  const storyMetaData = {
1372
1372
  title,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quintype/seo",
3
- "version": "1.50.3",
3
+ "version": "1.50.4-beta.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",
package/src/text-tags.js CHANGED
@@ -33,7 +33,7 @@ function buildTagsFromStory(config, story, url = {}, data = {}) {
33
33
  const ogUrl = customSeo.ogUrl || get(seo, ["og", "url"]) || storyUrl;
34
34
  const getOgTitle =
35
35
  customSeo.ogTitle || get(story, ["alternative", "social", "default", "headline"], story.headline) || story.headline;
36
- const ogDescription = customSeo.ogDescription || story.summary;
36
+ const ogDescription = customSeo.ogDescription || seo["meta-description"] || story.summary;
37
37
  const canonicalUrl = customSeo.canonicalUrl || story["canonical-url"] || storyUrl;
38
38
  const storyMetaData = {
39
39
  title,
@@ -530,6 +530,16 @@ describe('TextTags', function () {
530
530
  assertContains('<meta name="keywords" content="Footag"/>', string);
531
531
  });
532
532
 
533
+ it("uses seo meta-description for og:description when summary is missing", function () {
534
+ const seoConfig = {
535
+ generators: [TextTags],
536
+ enableOgTags: true
537
+ }
538
+ const story = { seo: { "meta-description": "Some Foobar" }, summary: null, tags: [], authors: [{ 'name': "foo" }] }
539
+ const string = getSeoMetadata(seoConfig, { "sketches-host": "http://foo.com" }, 'story-page', { data: { story: story } }, { url: url.parse("/my-page") })
540
+ assertContains('<meta property="og:description" content="Some Foobar"/>', string);
541
+ });
542
+
533
543
  it("Can generate news tags", function () {
534
544
  const seoConfig = {
535
545
  generators: [TextTags],