DEV Community


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

markusende profile image
Markus Ende • Edited

It works because of this code part on your page:

  let origin = "";
  if (typeof window !== "undefined") {
    origin = window.location.origin;

Twitterbot will use something like this to crawl the site:
curl -v -A Twitterbot

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