question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Meta tag with image url content

See original GitHub issue

I 'd like to add something like

    <meta property="og:image" content="./src/images/cover.png" />
    <meta name="twitter:image" content="./src/images/cover.png" />

I notice that it didn’t handle image inside the meta tag. And I found a solution here https://github.com/webpack/html-loader/issues/17#issuecomment-241038572

    <meta property="og:image" content="${require(`./src/images/cover.png`)}" />
    <meta name="twitter:image" content="${require(`./src/images/cover.png`)}" />

All we have to do is minor change in html loader setting loader: 'html?interpolate=require',

https://github.com/roadmanfong/create-react-app/commit/48bb6cf692ae401f8deba02cb53009be0f7a9b3e

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:35 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
gaearoncommented, Sep 17, 2016

I can’t really imagine why somebody would want to start their attributes with ./ and not mean a local file, so I think it will be safe to just assume that’s the intention.

1reaction
kahnerajacommented, Sep 17, 2016

thanks @gaearon i’ll look into it 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Essential Meta Tags for Social Media - CSS-Tricks
Facebook uses <meta> tags leveraging the Open Graph protocol, ... A URL to a unique image representing the content of the page.
Read more >
HTML meta tags cheatsheet - Devhints
The one-page guide to HTML meta tags: usage, examples, links, snippets, and more.
Read more >
Fixing the Preview Image, Title and Description for Shared Links
To modify a page's preview image, description, and additional metadata for these services, you can provide meta tags in the HTML code of...
Read more >
HowTo: Use images in Metatag - Drupal
The following outlines how to use an image field on a content type for populating image meta tag information.
Read more >
html - Meta tags for URL with description and image (In Skype ...
Is there someone who knows which tags are used to provide these images and descriptions on Skype and Discord? I tried adding some...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Hashnode Post

No results found