@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 +1 -1
- package/package.json +1 -1
- package/src/text-tags.js +1 -1
- package/test/text_tags_test.js +10 -0
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
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,
|
package/test/text_tags_test.js
CHANGED
|
@@ -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],
|