DEV Community

loading...

Discussion on: Use Front Matter Images for Twitter Card Images in GatsbyJS

Collapse
markusende profile image
Markus Ende • Edited

It works because of this code part on your page:

  let origin = "https://codinhood.com/";
  if (typeof window !== "undefined") {
    origin = window.location.origin;
  }

Twitterbot will use something like this to crawl the site:
curl -v -A Twitterbot https://codinhood.com/post/visualizing-apple-deaths.

The window will not be available there. You can see that in the curl response, because there you have a duplicate slash character in you URL.

Thread Thread
jinoantony profile image
Jino Antony

You are right