Skip to content

Commit

Permalink
Add fixed sizes for some images to prevent errors (Shopify#2087)
Browse files Browse the repository at this point in the history
* remove the mention of sizes where unnecessary

* remove another instance

* add fixed size to the images in structured data

* adjust size to 1920

* edit logo size in structured data

* remove conditional info

* change value to match other logo size values
  • Loading branch information
ludoboludo authored Nov 22, 2022
1 parent 2f9b9f3 commit 2eb8bf6
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 12 deletions.
2 changes: 1 addition & 1 deletion sections/featured-product.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@
"url": {{ request.origin | append: product.url | json }},
{% if seo_media -%}
"image": [
{{ seo_media | image_url: width: seo_media.preview_image.width | prepend: "https:" | json }}
{{ seo_media | image_url: width: 1920 | prepend: "https:" | json }}
],
{%- endif %}
"description": {{ product.description | strip_html | json }},
Expand Down
2 changes: 1 addition & 1 deletion sections/header.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@
"@type": "Organization",
"name": {{ shop.name | json }},
{% if section.settings.logo %}
"logo": {{ section.settings.logo | image_url: width: section.settings.logo.width | prepend: "https:" | json }},
"logo": {{ section.settings.logo | image_url: width: 500 | prepend: "https:" | json }},
{% endif %}
"sameAs": [
{{ settings.social_twitter_link | json }},
Expand Down
10 changes: 1 addition & 9 deletions sections/main-article.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@
{% endif %}
{% if article.image %}
"image": [
{{ article | image_url: width: article.image.width | prepend: "https:" | json }}
{{ article | image_url: width: 1920 | prepend: "https:" | json }}
],
{% endif %}
"datePublished": {{ article.published_at | date: '%Y-%m-%dT%H:%M:%SZ' | json }},
Expand All @@ -243,14 +243,6 @@
},
"publisher": {
"@type": "Organization",
{% if settings.share_image %}
"logo": {
"@type": "ImageObject",
"height": {{ settings.share_image.height | json }},
"url": {{ settings.share_image | image_url: width: settings.share_image.width | prepend: "https:" | json }},
"width": {{ settings.share_image.width | json }}
},
{% endif %}
"name": {{ shop.name | json }}
}
}
Expand Down
2 changes: 1 addition & 1 deletion sections/main-product.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@
"url": {{ request.origin | append: product.url | json }},
{% if seo_media -%}
"image": [
{{ seo_media | image_url: width: seo_media.preview_image.width | prepend: "https:" | json }}
{{ seo_media | image_url: width: 1920 | prepend: "https:" | json }}
],
{%- endif %}
"description": {{ product.description | strip_html | json }},
Expand Down

0 comments on commit 2eb8bf6

Please sign in to comment.