You are not logged in. Please login at to post your questions!


Create React App: Setting OG image with PUBIC_URL does not work

I am trying to set og-image to CRA app and I am doing like this:

<meta content="website" property="og:type"/>

<meta content="%PUBLIC_URL%/og-image.png" property="og:image"/>

<meta content="Tile goes here..." property="og:title"/>

An image is inside pubic folder, but the image does not show on op. When I do http://localhost:3000/og-images.png, it works. However, I do not want to set fixed value here.

What I am doing wrong?

Edit: my folder structure:

app - public - index.html - favicon.ico - og-image.png - src

asked 02 Aug '18, 11:10

kimberly_071's gravatar image

accept rate: 0%

toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:


question asked: 02 Aug '18, 11:10

question was seen: 175 times

last updated: 02 Aug '18, 11:10