{"id":27815,"date":"2022-03-21T19:24:03","date_gmt":"2022-03-21T19:24:03","guid":{"rendered":"http:\/\/Automatically-Generate-Social-Sharing-Images"},"modified":"2025-03-09T06:37:54","modified_gmt":"2025-03-09T13:37:54","slug":"automatically-generate-social-sharing-images","status":"publish","type":"post","link":"https:\/\/cloudinary.com\/blog\/guest_post\/automatically-generate-social-sharing-images\/","title":{"rendered":"Automatically Generate Social Sharing Images"},"content":{"rendered":"<div class=\"wp-block-cloudinary-markdown \"><p>Promoting your content on social media is an important part of the publishing process, but as anyone who has attempted to share their work online knows, social media is a black hole of content. It\u2019s really easy to publish, and then see your work lost in the endless stream of tweets and posts. But by sharing images or \u201cOpen Graph Images\u201d for your content, you can stand out more!<\/p>\n<p>These images are the ones shown as a previews in your followers\u2019 timelines, for example:\n&lt;img src=\u201chttps:\/\/res.cloudinary.com\/matiasfha\/image\/upload\/v1616598769\/Screen_Shot_2021-03-01_at_08.01.57_yhqtx8.png\u201d style={{ width : 500 }} \/&gt;<\/p>\n<p>Creating a share image for each post is a significant burden, and can slow down the publishing process, but there is good news. You can automate this, and get beatiful social image cards with just a bit of upfront effort.<\/p>\n<p>Before starting with this tutorial, we need to have a plan, and identify our outcomes. By the end of this article, we want to be able to automatically generate social media images by using the Cloudinary transformation API. This process will be part of a utility function that we can use in the Gatsby build process to generate the images for each article. We will asume that you have a running site using Gatsby, sourcing content from markdown or mdx, and that you have some knowledge of the <code>gatsby-node<\/code> API.<\/p>\n<p>The result will be something like this.  Obviously, it will depend of the template image that you use.<\/p>\n<p>&lt;img src=\u201chttps:\/\/res.cloudinary.com\/matiasfha\/image\/upload\/v1616598776\/Untitled_qujclk.png\u201d style={{ width : 500 }} \/&gt;<\/p>\n<p>The text content of this image is automatically generated by Cloudinary transformation by adding a text overlay for the title, and for the tags.<\/p>\n<h2>Cloudinary transformations<\/h2>\n<p>Cloudinary has a powerful transformation API that allows users to manipulate images in different ways with simple url parameters. One of those manipulations is the ability to add text overlays.<\/p>\n<blockquote>\n<p>You can use all of these features by creating a free Cloudinary account, and storing your social image there.<\/p>\n<\/blockquote>\n<p>Cloudinary offers a collection of transformations to add overlays. You can combine these parameters to place a piece of text anywhere in an image. The most simple example is to use the <code>l_text<\/code> transformation that tells Cloudinary to add a text overlay.<\/p>\n<h3>Step 1: Add a text overlay transformation<\/h3>\n<p><code>https:\/\/res.cloudinary.com\/matiasfha\/image\/upload\/co_white,l_text:roboto_84:This is the example text\/example_social_card.jpg<\/code><\/p>\n<p>&lt;img src=\u201chttps:\/\/res.cloudinary.com\/matiasfha\/image\/upload\/co_white,l_text:roboto_84:This%20is%20the%20example%20text\/example_social_card.jpg\u201d style={{ width : 500 }} \/&gt;<\/p>\n<p>Here, we just used the image\u2019s Cloudinary url, <code>example_social_card.jpg``,  hosted under the account <\/code>matiasfha` (or your cloud name in case you created your Cloudinary account) and we passed a transformation that is marked by using forward slashes.<\/p>\n<p>The transformation part here is <code>l_text:roboto_84:This%20is%20%20the%20example%20text <\/code> This is composed by<\/p>\n<ul>\n<li>\n<code>l_text<\/code> the text overlay transformation.<\/li>\n<li>\n<code>:roboto_84<\/code> the font family and font size we want to use.<\/li>\n<li>\n<code>This%20is%20%20the%20example%20text<\/code> is a url encoded version of the text that we can use to write into the overlay.<\/li>\n<li>\n<code>co_white<\/code> this sets the color of the text.<\/li>\n<\/ul>\n<blockquote>\n<p>You can see more information about the text overlay transformation in <a href=\"https:\/\/cloudinary.com\/documentation\/transformation_reference#l_text\">this page<\/a>. There, you can learn more about the styling parameters, use of custom fonts, line spacings, and other text related definitions.<\/p>\n<\/blockquote>\n<h3>Step 2 Position the text overlay<\/h3>\n<p>Next, we\u2019ll position the text in the place we need. To do that, we will add a few more transformations to this overlay.<\/p>\n<p>First, we will set the origin position of the text to some corner of the image so we can then \u201ctranslate\u201d it by using the <code>x<\/code> and <code>y<\/code> axis. This is done by setting the <code>gravity<\/code> parmater.<\/p>\n<p><code>g_south_west<\/code> this can be read as \u201cSet the gravity to south west point\u201d, or \u201cput the origin of the image at the bottom left corner\u201d.<\/p>\n<p>If we add that to the url, we get this:<\/p>\n<p><code>https:\/\/res.cloudinary.com\/matiasfha\/image\/upload\/g_south_west,co_white,l_text:roboto_84:This%20is%20the%20example%20text\/example_social_card.jpg <\/code><\/p>\n<p>&lt;img src=\u201chttps:\/\/res.cloudinary.com\/matiasfha\/image\/upload\/g_south_west,co_white,l_text:roboto_84:This%20is%20the%20example%20text\/example_social_card.jpg \u201c style={{ width : 500 }} \/&gt;<\/p>\n<p>Now, to position this overlay, we will use pixels. Therefore, it\u2019s a good idea to define the size of the working canvas by limiting the width and height of the image. The most frecuently recommended size for a social sharing image (og:image) is 1200&#215;627 pixels (1.91\/1 ratio). To implement this, we will use another transformation for the image itself.<\/p>\n<p><code>https:\/\/res.cloudinary.com\/matiasfha\/image\/upload\/w_1200,h_627,c_fill,q_auto,f_auto\/g_south_west,co_white,l_text:roboto_84:This%20is%20the%20example%20text\/example_social_card.jpg<\/code><\/p>\n<p>We just added a new transformation between the forward slashes. &#8220;\/w_120,h_627,c_fill,q_auto,f_auto` This means that we want an image with<\/p>\n<ul>\n<li>\n<code>w_1200<\/code> 1200px of width<\/li>\n<li>\n<code>h_627<\/code> 627px of height<\/li>\n<li>\n<code>c_fill<\/code> that will automatically fill the size<\/li>\n<li>\n<code>q_auto<\/code> with automatic quality<\/li>\n<li>\n<code>f_auto<\/code> and automatic format<\/li>\n<\/ul>\n<p>Now, let\u2019s go back to the text overlay, and position the text in a better place. To do that, we will use the X and Y offsets. This is done by just adding <code>x_&lt;number&gt;,y_&lt;number&gt;<\/code>, where <code>&lt;number&gt;<\/code> is a value in pixels, used to move the overlay to some place.<\/p>\n<p><code>https:\/\/res.cloudinary.com\/matiasfha\/image\/upload\/w_1200,h_627,c_fill,q_auto,f_auto\/x_480,y_254,g_south_west,co_white,l_text:roboto_84:This%20is%20the%20example%20text\/example_social_card.jpg<\/code><\/p>\n<h3>Step 3 Manage text overflow<\/h3>\n<p>What happen if the text is too long?<\/p>\n<p>&lt;img src=\u201chttps:\/\/res.cloudinary.com\/matiasfha\/image\/upload\/w_1200,h_627,c_fill,q_auto,f_auto\/x_480,y_254,g_south_west,co_white,l_text:roboto_84:This%20is%20the%20example%20text.%20And%20now%20is%20too%20long\/example_social_card.jpg\u201d style={{ width : 700 }} \/&gt;<\/p>\n<p>The text overlay will overflow. We can control that by setting a width for the overlay so the text will wrap, and not overflow. This is done by just using the <code>w_&lt;number&gt;<\/code> transformation on the overlay.<\/p>\n<p><code>https:\/\/res.cloudinary.com\/matiasfha\/image\/upload\/w_1200,h_627,c_fill,q_auto,f_auto\/w_600,x_480,y_254,g_south_west,co_white,l_text:roboto_84:This%20is%20th%20example%20text%20And%20now%20is%20too%20long\/example_social_card.jpg<\/code><\/p>\n<p>&lt;img src=\u201chttps:\/\/res.cloudinary.com\/matiasfha\/image\/upload\/w_1200,h_627,c_fill,q_auto,f_auto\/w_600,x_480,y_254,g_south_west,co_white,l_text:roboto_84:This%20is%20the%20example%20text.%20And%20now%20is%20too%20long\/example_social_card.jpg\u201d style={{ width : 500 }} \/&gt;<\/p>\n<p>And now we are done! We have an image that has automatic text overlay on it. Now we need to transform that url into a reusable utility function that we can add to the Gatsby build process.<\/p>\n<h2>Create a utility function<\/h2>\n<h3>Step 1: Identify our needs<\/h3>\n<p>The first step is to identify what we need, and what parameters we will require.<\/p>\n<p>The url is composed by at least 2 of the following transformations: the base url, the cloud name, and the file name.<\/p>\n<p><code>https:\/\/res.cloudinary.com\/matiasfha\/image\/upload\/w_1200,h_627,c_fill,q_auto,f_auto\/w_600,x_480,y_254,g_south_west,co_white,l_text:roboto_84:This%20is%20the%20example%20text\/example_social_card.jpg<\/code><\/p>\n<ul>\n<li>base url: <a href=\"https:\/\/res.cloudiunary.com\">https:\/\/res.cloudiunary.com<\/a>\n<\/li>\n<li>cloud name: matiasfha<\/li>\n<li>image transformation <code>[<\/code>w_1200,h_627,c_fill,q_auto,f_auto<code>](https:\/\/res.cloudinary.com\/matiasfha\/image\/upload\/w_1200,h_627,c_fill,q_auto,f_auto\/w_600,x_480,y_254,g_south_west,co_white,l_text:roboto_64:This%20is%20the%20example%20text%20but%20now%20is%20too%20long\/example_social_card.jpg)<\/code>\n<\/li>\n<li>text overlay transformation `[w_600,x_480,y_254,g_south_west,co_white,l_text:roboto_64:This%20is%20the%20example%20text%20but%20now%20is%20too%20long]-<\/li>\n<li>image file: <code>example_social_card.jpg<\/code>\n<\/li>\n<\/ul>\n<p>Here, the variable parts can be:<\/p>\n<ul>\n<li>the cloud name<\/li>\n<li>the image file name<\/li>\n<li>the text used in the text overlay<\/li>\n<li>the text width<\/li>\n<li>the text position<\/li>\n<li>the text color, font family and font size<\/li>\n<\/ul>\n<p>For simplicity, we will use the cloud name and the text content as variables.<\/p>\n<h3>Step 2: Create a utility function<\/h3>\n<p>Now, let\u2019s create the function:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-wrap-lines\"><span class=\"hljs-keyword\">const<\/span> createSharingImage = <span class=\"hljs-function\">(<span class=\"hljs-params\">{ cloudName, text }<\/span>) =&gt;<\/span> {\n\n}\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>What will this function return?<\/p>\n<p>Since we need a url to load the image, it will only return a string:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-wrap-lines\"><span class=\"hljs-keyword\">const<\/span> createSharingImage = <span class=\"hljs-function\">(<span class=\"hljs-params\">{ cloudName, text }<\/span>) =&gt;<\/span> {\n\t<span class=\"hljs-keyword\">return<\/span> imageUrl\n}\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>And, what will the function do?<\/p>\n<p>The function will recreate the image url based on the pieces that we define within the url.<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-wrap-lines\"><span class=\"hljs-keyword\">const<\/span> createSharingImage = <span class=\"hljs-function\">(<span class=\"hljs-params\">{ cloudName, text }<\/span>) =&gt;<\/span> {\n\t<span class=\"hljs-keyword\">const<\/span> imageTransformations = &#91;]\n\t<span class=\"hljs-keyword\">const<\/span> textTransformations = &#91;]\n  <span class=\"hljs-keyword\">const<\/span> baseUrl = <span class=\"hljs-string\">`https:\/\/res.cloudinary.com\/<span class=\"hljs-subst\">${cloudName}<\/span>\/image\/upload\/`<\/span>\n\t<span class=\"hljs-keyword\">return<\/span> imageUrl\n}\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>Let\u2019s see what each of these transformation variables will contain. We will use an array-like shape when writing them because it\u2019s more readable than a collection of text parameters.<\/p>\n<h3>Step 3: Define the image transfromations<\/h3>\n<p>The first variable is the content for the image transformation, a collection of strings that we will join with as a comma separated string. This shape allows us to add more transformations if we are required.<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php shcb-wrap-lines\"><span class=\"hljs-keyword\">const<\/span> imageTransformations = &#91;\n\t<span class=\"hljs-string\">'w_1200'<\/span>,\n\t<span class=\"hljs-string\">'h_627'<\/span>,\n\t<span class=\"hljs-string\">'c_fill'<\/span>,\n\t<span class=\"hljs-string\">'q_auto'<\/span>,\n\t<span class=\"hljs-string\">'f_auto'<\/span>\n].join(<span class=\"hljs-string\">', )\n<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<h3>Step 4: Define the text transformations<\/h3>\n<p>Next, we have the text transformations:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-wrap-lines\"><span class=\"hljs-keyword\">const<\/span> textTransformations = &#91;\n\t<span class=\"hljs-string\">'w_600'<\/span>,\n\t<span class=\"hljs-string\">'x_480'<\/span>,\n\t<span class=\"hljs-string\">'y_254'<\/span>,\n\t<span class=\"hljs-string\">'g_south_west'<\/span>,\n\t<span class=\"hljs-string\">'co_white'<\/span>,\n  <span class=\"hljs-string\">`l_text:roboto_64:<span class=\"hljs-subst\">${<span class=\"hljs-built_in\">encodeURIComponent<\/span>(text)}<\/span>`<\/span>\n].join(<span class=\"hljs-string\">','<\/span>)\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<h3>Step 5: Polish the final utility function<\/h3>\n<p>Finally, our function will just join all of these to return the image url.<\/p>\n<p><a href=\"https:\/\/gist.github.com\/matiasfha\/27fc927bfcc63416e2602aedbf73f423\">https:\/\/gist.github.com\/matiasfha\/27fc927bfcc63416e2602aedbf73f423<\/a><\/p>\n<h2>Integrate this utility with Gatsby<\/h2>\n<p>You can use this utility function directly in any piece of code, including the post template in your Gatsby setup. Just check on the following.<\/p>\n<p>Let\u2019s assume that you are using a common Gatsby setup like <code>[gatsby-starter-blog](https:\/\/www.gatsbyjs.com\/starters\/gatsbyjs\/gatsby-starter-blog)<\/code>.<\/p>\n<p>This allows you to use markdown files to create your articles.  In this instance, markdown files are stored under the <code>content\/blog<\/code> folder, and the actual page build is based on the template available in <code>\/src\/templates\/blog-post.js<\/code>.<\/p>\n<p>The template uses a component named <code>Seo<\/code>, and this component uses <code>react-helmet<\/code> to create the required meta tags.<\/p>\n<p>The open graph images (Facebook sharing cards and Twitter cards) are defined by a few html meta tags.<\/p>\n<ul>\n<li>og:image An image URL, which should represent your object within the graph.<\/li>\n<li>For Twitter, we need <code>twitter:card<\/code> and <code>twitter:image<\/code>.<\/li>\n<\/ul>\n<h3>Step 1: Update the Seo component<\/h3>\n<p>So, we will update the <code>Seo<\/code> component to use our <code>createShareImage<\/code>utility function.<\/p>\n<p><a href=\"https:\/\/gist.github.com\/matiasfha\/890bb2c6338bed840db618558628ff7f\">https:\/\/gist.github.com\/matiasfha\/890bb2c6338bed840db618558628ff7f<\/a><\/p>\n<p>We will use some of the data that already comes into the component- in this case, the <code>title<\/code>. Let\u2019s add the call to our function under <code>defaultTitle<\/code> (line 31).<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-wrap-lines\"><span class=\"hljs-keyword\">const<\/span> ogImage =  createSharingImage({ <span class=\"hljs-attr\">cloudName<\/span>:<span class=\"hljs-string\">'Your cloudinary cloud name'<\/span>, <span class=\"hljs-attr\">text<\/span>: title })\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>And now, let\u2019s add the new meta tags into Helmet by adding the following at line 72:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css shcb-wrap-lines\">{\n\t<span class=\"hljs-attribute\">name<\/span>:<span class=\"hljs-string\">'og:image'<\/span>,\n\tcontent: ogImage\n},\n{\n\t<span class=\"hljs-attribute\">name<\/span>: <span class=\"hljs-string\">'twitter:image'<\/span>,\n  content: ogImage\n}\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<h3>Step 2: Test the new social images<\/h3>\n<p>After saving, run your new code in development mode by calling <code>gatsby develop<\/code> in the terminal. Open any article in your browser, and check the element of the page with your developer tools. You should be able to see the new meta tags inside the <code>&lt;head&gt;<\/code> tag, indicating the new sharing images hosted in Cloudinary.<\/p>\n<p>&lt;img src=\u201chttps:\/\/res.cloudinary.com\/matiasfha\/image\/upload\/v1616598987\/devtools_vll6oa.png\u201d style={{ width : 700 }} \/&gt;<\/p>\n<h2>Let\u2019s tap into the Gatsby build process<\/h2>\n<p>One of the benefits of using Gatsby as a framework is the API that allows you to tap into the build process at any point.<\/p>\n<p>Gatsby offers a powerful API that allows us to get all of the content used as sources through a Graphql interface.<\/p>\n<p>To be able to use these APIs, you need to add or modify the nodes. This is done by using the file <code>gatsby-node.js<\/code>. It is the file where we will add the required code in order to add a new attribute to some Nodes to host these sharing images.<\/p>\n<p>Let\u2019s return to our example site, created by gatsby-started-blog. We know that we have the <code>seo.js<\/code> component that allows us to manipualte the content of the header by adding new meta tags used by the search engine crawlers.<\/p>\n<p>Whe we are talking about the articles in the site, the data rendered by the <code>seo<\/code> component comes from the frontmatter. So if we want to automatically add the sharing image, we need to add that attribute to the article\u2019s frontmatter.<\/p>\n<h3>Step 1: Manage schema definitions<\/h3>\n<p>To do this, we need to change or update the schema definition used by GraphQL. We will use the <code>createSchemaCutomization<\/code> API to add a field extension.<\/p>\n<p>The extension that we will add will be named <code>ogImage<\/code>.<\/p>\n<p>Let update the content in the <code>gatsby-node.js<\/code> file.<\/p>\n<p>Since this file already uses <code>createSchemaCustomization<\/code>, we will just add more logic to it. First, let\u2019s destructure the <code>actions<\/code> argument to get access to the <code>createFieldExtension<\/code> API.<\/p>\n<blockquote>\n<p>Read more about schema customization in the <a href=\"https:\/\/www.gatsbyjs.com\/docs\/reference\/graphql-data-layer\/schema-customization\/\">Gatsby docs<\/a>.<\/p>\n<\/blockquote>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-wrap-lines\"><span class=\"hljs-keyword\">const<\/span> { createFieldExtension, createTypes } = actions\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>Now, let\u2019s use <code>createFieldExtension<\/code> to create the extension <code>ogImage<\/code>.<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css shcb-wrap-lines\"><span class=\"hljs-selector-tag\">createFieldExtension<\/span>({\n    <span class=\"hljs-attribute\">name<\/span>: <span class=\"hljs-string\">'ogImage'<\/span>,\n    <span class=\"hljs-built_in\">extend<\/span>(options, prevFieldConfig){\n      return {\n        <span class=\"hljs-built_in\">resolve<\/span>(source) {\n          return <span class=\"hljs-built_in\">createSharingImage<\/span>({ cloudName: <span class=\"hljs-string\">'matiasfha'<\/span>, text: source.title })\n        }\n      }\n    }\n  })\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-9\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>Here, we will do the call to our  <code>crateSharingImage<\/code>, and will pass the data required: the <code>cloudName<\/code> (that can come from env variables), and the <code>text<\/code> that will only be in the title.<\/p>\n<p>This function is extending the Node fields, and reading the data from the <code>source<\/code> node.<\/p>\n<p>You can see the end result of this change in the <a href=\"https:\/\/github.com\/matiasfha\/gatsby-starter-blog-og-images\/blob\/main\/gatsby-node.js#L82-L94\">following file in the example repository<\/a><\/p>\n<h3>Step 2: Use the new field extension<\/h3>\n<p>Now, we need to use this extension. The extensions are used in the GraphQL schema.<\/p>\n<p>In the same place in the file, you will see a call to <code>createTypes<\/code>.  This actually defines the GraphQL schema. Update the <code>FrontMatter<\/code> type to add the new field.<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-10\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css shcb-wrap-lines\">`<span class=\"hljs-selector-tag\">type<\/span> <span class=\"hljs-selector-tag\">Frontmatter<\/span> {\n\t<span class=\"hljs-attribute\">title<\/span>: String\n\tdescription: String\n\tdata: Date @dateformat\n\togImage: String @ogImage\n}\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-10\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>We tell Gatsby that the frontmatter of the files will have a String field\/attribute named <code>ogImage<\/code> that will automatically resolve to the  url created by <code>createSharingImage<\/code>.<\/p>\n<h3>Step 3: Update Seo component<\/h3>\n<p>Now, the last step is to update the  <code>seo.js<\/code> component to write the new meta tags from this new data.<\/p>\n<p>So, let\u2019s receive this attribute as a prop:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-11\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-wrap-lines\"><span class=\"hljs-keyword\">const<\/span> SEO = <span class=\"hljs-function\">(<span class=\"hljs-params\">{ description, lang, meta, title, ogImage = <span class=\"hljs-string\">''<\/span> }<\/span>) =&gt;<\/span> {\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-11\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>and add this at the bottom of the <code>Helmet<\/code> call:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-12\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css shcb-wrap-lines\">{\n          <span class=\"hljs-attribute\">name<\/span>: `twitter:image`,\n          content: ogImage\n        },\n        {\n          <span class=\"hljs-attribute\">name<\/span>: `og:image`,\n          content: ogImage\n        }\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-12\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<h3>Step 4: Update the post template<\/h3>\n<p>Finally, update the <code>blog-post.js<\/code> template<code>, and add the <\/code>ogImage` prop:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-13\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml shcb-wrap-lines\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">SEO<\/span>\n        <span class=\"hljs-attr\">title<\/span>=<span class=\"hljs-string\">{post.frontmatter.title}<\/span>\n        <span class=\"hljs-attr\">description<\/span>=<span class=\"hljs-string\">{post.frontmatter.description<\/span> || <span class=\"hljs-attr\">post.excerpt<\/span>}\n        <span class=\"hljs-attr\">ogImage<\/span>=<span class=\"hljs-string\">{post.frontmatter.ogImage}<\/span>\n      \/&gt;<\/span>\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-13\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>Now, run your site with <code>gatsby develop<\/code>, and you will be able to see the automatic ogImage, generated for your artilces, directly in the meta tags, or by checking the query in the GraphQL playground.<\/p>\n<p>You can find a working version of this in <a href=\"https:\/\/github.com\/matiasfha\/gatsby-starter-blog-og-images\">this repository in github<\/a> and also check <a href=\"https:\/\/codesandbox.io\/s\/gatsby-blog-with-og-images-xdjqf\">this codesandbox<\/a><\/p>\n<\/div>\n  \n  <div class=\"wp-block-cloudinary-code-sandbox \">\n    <iframe\n      src=\"https:\/\/codesandbox.io\/embed\/gatsby-blog-with-og-images-xdjqf?theme=dark&amp;codemirror=1&amp;highlights=&amp;editorsize=50&amp;fontsize=14&amp;expanddevtools=0&amp;hidedevtools=0&amp;eslint=0&amp;forcerefresh=0&amp;hidenavigation=0&amp;initialpath=%2F&amp;module=%2Fgatsby-node.js&amp;moduleview=0&amp;previewwindow=&amp;view=&amp;runonclick=1\"\n      height=\"500\"\n      style=\"width: 100%;\"\n      title=\"Gatsby using OG images from Cloudinary\"\n      loading=\"lazy\"\n      allow=\"accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking\"\n      sandbox=\"allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts\"\n    ><\/iframe>\n  <\/div>\n\n  <div class=\"wp-block-cloudinary-markdown \"><h2>Summary<\/h2>\n<p>In this article, we leveraged the power of Cloudinary image manipulation through the transformation url to automatically add text to a pre-defined image. We also wrote this as a reusable function, and then used that function inside Gatsby build system to automatically add the sharing images to our articles.<\/p>\n<h3>Learn More<\/h3>\n<ul>\n<li>\n<a href=\"https:\/\/www.gatsbyjs.com\/docs\/reference\/graphql-data-layer\/schema-customization\/\">Gatsby Schema Customization<\/a>\n<\/li>\n<li>\n<a href=\"https:\/\/cloudinary.com\/documentation\/transformation_reference\">Transformation URL API reference<\/a>\n<\/li>\n<li>\n<a href=\"https:\/\/github.com\/gatsbyjs\/gatsby-starter-blog\">Gatsby Starter Blog<\/a>\n<\/li>\n<\/ul>\n<\/div>","protected":false},"excerpt":{"rendered":"","protected":false},"author":41,"featured_media":27816,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_cloudinary_featured_overwrite":false,"footnotes":""},"categories":[1],"tags":[381,378,134,370,175,371],"class_list":["post-27815","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-imagecdn","tag-gatsbyjs","tag-guest-post","tag-image","tag-jamstack","tag-under-review"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.6 (Yoast SEO v26.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Automatically Generate Social Sharing Images<\/title>\n<meta name=\"description\" content=\"Promoting your content on social media is an important part of the publishing process, but as anyone who has attempted to share their work online knows, social media is a black hole of content. It&#039;s really easy to publish, and then see your work lost in the endless stream of tweets and posts. But by sharing images or &quot;Open Graph Images&quot; for your content, you can stand out more!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cloudinary.com\/blog\/guest_post\/automatically-generate-social-sharing-images\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Automatically Generate Social Sharing Images\" \/>\n<meta property=\"og:description\" content=\"Promoting your content on social media is an important part of the publishing process, but as anyone who has attempted to share their work online knows, social media is a black hole of content. It&#039;s really easy to publish, and then see your work lost in the endless stream of tweets and posts. But by sharing images or &quot;Open Graph Images&quot; for your content, you can stand out more!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cloudinary.com\/blog\/guest_post\/automatically-generate-social-sharing-images\/\" \/>\n<meta property=\"og:site_name\" content=\"Cloudinary Blog\" \/>\n<meta property=\"article:published_time\" content=\"2022-03-21T19:24:03+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-03-09T13:37:54+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/v1681926183\/Web_Assets\/blog\/da83ff14814f91ed3a5fb750738c9182976232d5-3200x2400-1_2781615d69\/da83ff14814f91ed3a5fb750738c9182976232d5-3200x2400-1_2781615d69-jpg?_i=AA\" \/>\n\t<meta property=\"og:image:width\" content=\"3200\" \/>\n\t<meta property=\"og:image:height\" content=\"2400\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"NewsArticle\",\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/automatically-generate-social-sharing-images\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/automatically-generate-social-sharing-images\/\"},\"author\":{\"name\":\"\",\"@id\":\"\"},\"headline\":\"Automatically Generate Social Sharing Images\",\"datePublished\":\"2022-03-21T19:24:03+00:00\",\"dateModified\":\"2025-03-09T13:37:54+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/automatically-generate-social-sharing-images\/\"},\"wordCount\":5,\"publisher\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/automatically-generate-social-sharing-images\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681926183\/Web_Assets\/blog\/da83ff14814f91ed3a5fb750738c9182976232d5-3200x2400-1_2781615d69\/da83ff14814f91ed3a5fb750738c9182976232d5-3200x2400-1_2781615d69.jpg?_i=AA\",\"keywords\":[\"(Image)CDN\",\"GatsbyJS\",\"Guest Post\",\"Image\",\"JAMStack\",\"Under Review\"],\"inLanguage\":\"en-US\",\"copyrightYear\":\"2022\",\"copyrightHolder\":{\"@id\":\"https:\/\/cloudinary.com\/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/automatically-generate-social-sharing-images\/\",\"url\":\"https:\/\/cloudinary.com\/blog\/guest_post\/automatically-generate-social-sharing-images\/\",\"name\":\"Automatically Generate Social Sharing Images\",\"isPartOf\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/automatically-generate-social-sharing-images\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/automatically-generate-social-sharing-images\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681926183\/Web_Assets\/blog\/da83ff14814f91ed3a5fb750738c9182976232d5-3200x2400-1_2781615d69\/da83ff14814f91ed3a5fb750738c9182976232d5-3200x2400-1_2781615d69.jpg?_i=AA\",\"datePublished\":\"2022-03-21T19:24:03+00:00\",\"dateModified\":\"2025-03-09T13:37:54+00:00\",\"description\":\"Promoting your content on social media is an important part of the publishing process, but as anyone who has attempted to share their work online knows, social media is a black hole of content. It's really easy to publish, and then see your work lost in the endless stream of tweets and posts. But by sharing images or \\\"Open Graph Images\\\" for your content, you can stand out more!\",\"breadcrumb\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/automatically-generate-social-sharing-images\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cloudinary.com\/blog\/guest_post\/automatically-generate-social-sharing-images\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/automatically-generate-social-sharing-images\/#primaryimage\",\"url\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681926183\/Web_Assets\/blog\/da83ff14814f91ed3a5fb750738c9182976232d5-3200x2400-1_2781615d69\/da83ff14814f91ed3a5fb750738c9182976232d5-3200x2400-1_2781615d69.jpg?_i=AA\",\"contentUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681926183\/Web_Assets\/blog\/da83ff14814f91ed3a5fb750738c9182976232d5-3200x2400-1_2781615d69\/da83ff14814f91ed3a5fb750738c9182976232d5-3200x2400-1_2781615d69.jpg?_i=AA\",\"width\":3200,\"height\":2400},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/automatically-generate-social-sharing-images\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/cloudinary.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Automatically Generate Social Sharing Images\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#website\",\"url\":\"https:\/\/cloudinary.com\/blog\/\",\"name\":\"Cloudinary Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/cloudinary.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\",\"name\":\"Cloudinary Blog\",\"url\":\"https:\/\/cloudinary.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA\",\"contentUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA\",\"width\":312,\"height\":60,\"caption\":\"Cloudinary Blog\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Automatically Generate Social Sharing Images","description":"Promoting your content on social media is an important part of the publishing process, but as anyone who has attempted to share their work online knows, social media is a black hole of content. It's really easy to publish, and then see your work lost in the endless stream of tweets and posts. But by sharing images or \"Open Graph Images\" for your content, you can stand out more!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/cloudinary.com\/blog\/guest_post\/automatically-generate-social-sharing-images\/","og_locale":"en_US","og_type":"article","og_title":"Automatically Generate Social Sharing Images","og_description":"Promoting your content on social media is an important part of the publishing process, but as anyone who has attempted to share their work online knows, social media is a black hole of content. It's really easy to publish, and then see your work lost in the endless stream of tweets and posts. But by sharing images or \"Open Graph Images\" for your content, you can stand out more!","og_url":"https:\/\/cloudinary.com\/blog\/guest_post\/automatically-generate-social-sharing-images\/","og_site_name":"Cloudinary Blog","article_published_time":"2022-03-21T19:24:03+00:00","article_modified_time":"2025-03-09T13:37:54+00:00","og_image":[{"width":3200,"height":2400,"url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/v1681926183\/Web_Assets\/blog\/da83ff14814f91ed3a5fb750738c9182976232d5-3200x2400-1_2781615d69\/da83ff14814f91ed3a5fb750738c9182976232d5-3200x2400-1_2781615d69-jpg?_i=AA","type":"image\/jpeg"}],"twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/cloudinary.com\/blog\/guest_post\/automatically-generate-social-sharing-images\/#article","isPartOf":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/automatically-generate-social-sharing-images\/"},"author":{"name":"","@id":""},"headline":"Automatically Generate Social Sharing Images","datePublished":"2022-03-21T19:24:03+00:00","dateModified":"2025-03-09T13:37:54+00:00","mainEntityOfPage":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/automatically-generate-social-sharing-images\/"},"wordCount":5,"publisher":{"@id":"https:\/\/cloudinary.com\/blog\/#organization"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/automatically-generate-social-sharing-images\/#primaryimage"},"thumbnailUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681926183\/Web_Assets\/blog\/da83ff14814f91ed3a5fb750738c9182976232d5-3200x2400-1_2781615d69\/da83ff14814f91ed3a5fb750738c9182976232d5-3200x2400-1_2781615d69.jpg?_i=AA","keywords":["(Image)CDN","GatsbyJS","Guest Post","Image","JAMStack","Under Review"],"inLanguage":"en-US","copyrightYear":"2022","copyrightHolder":{"@id":"https:\/\/cloudinary.com\/#organization"}},{"@type":"WebPage","@id":"https:\/\/cloudinary.com\/blog\/guest_post\/automatically-generate-social-sharing-images\/","url":"https:\/\/cloudinary.com\/blog\/guest_post\/automatically-generate-social-sharing-images\/","name":"Automatically Generate Social Sharing Images","isPartOf":{"@id":"https:\/\/cloudinary.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/automatically-generate-social-sharing-images\/#primaryimage"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/automatically-generate-social-sharing-images\/#primaryimage"},"thumbnailUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681926183\/Web_Assets\/blog\/da83ff14814f91ed3a5fb750738c9182976232d5-3200x2400-1_2781615d69\/da83ff14814f91ed3a5fb750738c9182976232d5-3200x2400-1_2781615d69.jpg?_i=AA","datePublished":"2022-03-21T19:24:03+00:00","dateModified":"2025-03-09T13:37:54+00:00","description":"Promoting your content on social media is an important part of the publishing process, but as anyone who has attempted to share their work online knows, social media is a black hole of content. It's really easy to publish, and then see your work lost in the endless stream of tweets and posts. But by sharing images or \"Open Graph Images\" for your content, you can stand out more!","breadcrumb":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/automatically-generate-social-sharing-images\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cloudinary.com\/blog\/guest_post\/automatically-generate-social-sharing-images\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudinary.com\/blog\/guest_post\/automatically-generate-social-sharing-images\/#primaryimage","url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681926183\/Web_Assets\/blog\/da83ff14814f91ed3a5fb750738c9182976232d5-3200x2400-1_2781615d69\/da83ff14814f91ed3a5fb750738c9182976232d5-3200x2400-1_2781615d69.jpg?_i=AA","contentUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681926183\/Web_Assets\/blog\/da83ff14814f91ed3a5fb750738c9182976232d5-3200x2400-1_2781615d69\/da83ff14814f91ed3a5fb750738c9182976232d5-3200x2400-1_2781615d69.jpg?_i=AA","width":3200,"height":2400},{"@type":"BreadcrumbList","@id":"https:\/\/cloudinary.com\/blog\/guest_post\/automatically-generate-social-sharing-images\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cloudinary.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Automatically Generate Social Sharing Images"}]},{"@type":"WebSite","@id":"https:\/\/cloudinary.com\/blog\/#website","url":"https:\/\/cloudinary.com\/blog\/","name":"Cloudinary Blog","description":"","publisher":{"@id":"https:\/\/cloudinary.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cloudinary.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/cloudinary.com\/blog\/#organization","name":"Cloudinary Blog","url":"https:\/\/cloudinary.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA","contentUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA","width":312,"height":60,"caption":"Cloudinary Blog"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":""}]}},"jetpack_featured_media_url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681926183\/Web_Assets\/blog\/da83ff14814f91ed3a5fb750738c9182976232d5-3200x2400-1_2781615d69\/da83ff14814f91ed3a5fb750738c9182976232d5-3200x2400-1_2781615d69.jpg?_i=AA","_links":{"self":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/27815","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/comments?post=27815"}],"version-history":[{"count":1,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/27815\/revisions"}],"predecessor-version":[{"id":37169,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/27815\/revisions\/37169"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/media\/27816"}],"wp:attachment":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/media?parent=27815"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/categories?post=27815"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/tags?post=27815"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}